Android Question App Crash after install on Sony Xperia Z2 and AVD

Mousa Najafi

Member
Licensed User
Longtime User
I've tested attached app successfully on galaxy S4 mini, S5 ,Note4, Sony Xperia Z ,Z1
but it crashes on AVD and Sony Xperia Z2 by following errors in each one:

Sony Xperia Z2 error after install (tested by market reviewer not me so I have not detail info):

An error has occurred in sub: java.lang.IlllegalArgumentException: n<=0:0

AVD Error after run in release mode:

customlistview_vvvvvvvvvvv1 (java line: 172)
java.lang.NullPointerException
at com.voicecommand.persian.customlistview._vvvvvvvvvvv1(customlistview.java:172)
at com.voicecommand.persian.main._vvvvvvvvvvvvv0(main.java:1589)
at com.voicecommand.persian.main._activity_create(main.java:408)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at com.voicecommand.persian.main.afterFirstLayout(main.java:98)
at com.voicecommand.persian.main.access$100(main.java:16)
at com.voicecommand.persian.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException

I couldn't reproduce crash on devices that I have . please help me what is wrong
I added SetManifestAttribute("android:installLocation", "auto") to manifest editor instead of #CanInstallToExternalStorage: true , but it didn't solve crash on AVD and after this change ,I have to send again to market to test it . Am I on right way or something else should be corrected?
 
Last edited:

Mousa Najafi

Member
Licensed User
Longtime User
Actually it works fine on all my devices .just after uploading to market(local market not googleplay) ;they are telling
it crash immediately after install. maybe something is wrong with certificates and private sign key.
 
Upvote 0

Mousa Najafi

Member
Licensed User
Longtime User
Happy new year
There is no need for persian language pack. I can run on my devices successfully. problem arises in emulator
and when the market reviewer testing it. App crashes in first run when they download and install hence rejecting my app. I get hopeless what to do. this is my first publish to market
please help me!
 
Upvote 0

khosrwb

Active Member
Licensed User
Longtime User
hi
please run your app on (( Debuge Legacy mode )) then see where error occured

I had a problem like you.



B4X:
Private Sub GetViewAtXY(X As Float, Y As Float) As Object
    For Each v As View In pnlContent.GetAllViewsRecursive
      
            If X >= v.Left And X <= v.Left + v.Width And Y >= v.Top And Y <= v.Top + v.Height Then       'this line is 469
                Return v
            End If
       
    Next
    Return v   
End Sub

I chenge them to this :

B4X:
Private Sub GetViewAtXY(X As Float, Y As Float) As Object
    For Each v As View In pnlContent.GetAllViewsRecursive
        If v Is ListView Then
            If X >= v.Left And X <= v.Left + v.Width And Y >= v.Top And Y <= v.Top + v.Height Then       'this line is 469
                Return v
            End If
        End If 
    Next
    Return v     
End Sub

I hope solved your problem
 
Upvote 0
Top