Android Question Error runing App in Debug

Abílio Magalhães

Member
Licensed User
Longtime User
Everytime I try to run the App in Debug(legacy), it crashes when it's ready to run (after instalation), the error that promps is the next one:

B4X:
Installing file.
PackageAdded: package:com.appname
activity_x_process_globals (java line: 8051)
java.lang.VerifyError: Rejecting class com.appname.activity_x because it failed compile-time verification (declaration of 'com.appname.activity_x' appears in /data/app/com.appname-1/base.apk)
    at com.appname.activity_x._process_globals(activity_x.java:8051)
    at com.activity_x.main.initializeProcessGlobals(main.java:32256)
    at com.activity_x.main.afterFirstLayout(main.java:98)
    at com.activity_x.main.access$000(main.java:17)
    at com.activity_x.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6117)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)


If I run the app in Release mode it goes normally without any issue. This started from nowhere.
I've found this in Google code page: https://code.google.com/p/android/issues/detail?id=80961
I don't know if it's related to what they say there, but if it is what's the turn around?

Note that I've 2 Build configurations that I use.
The App name and the activity related names were changed, but the point is still good to verification.
 

Abílio Magalhães

Member
Licensed User
Longtime User
Why aren't you using Debug (rapid) mode? Can you post the code in Activity_X.Process_Globals?
No Erel, I'm using Debug (legacy), as usual.

The process globals are the following:

B4X:
Sub Process_Globals
    Dim SQL1 As SQL
    Dim admin    As BluetoothAdmin
    Dim foundDevices As List
 
End Sub

This Activity is the biggest one in the project, idk if that helps.
When I run on Debug(rapid) the message that prompted say that the code is too large for a try statment.
I'll try to break the code in small parts on this activity and check if it solves the issue.
I've read somewhere that the limit per method is 64kb, and this activity is quite big though.
Sorry for the late reply.
 
Last edited:
Upvote 0

Abílio Magalhães

Member
Licensed User
Longtime User
Well that was the problem.

I've refactored the Activity code and splitted it into multiple methods and the debug now runs without any issue.

It was indeed a large method that I had, which in debug could pass over the 64kb allowed per method and resulted in the described error.

Thanks for the help.
 
Upvote 0
Top