Android Question RadioButton works in debug fails in release

Robert Valentino

Well-Known Member
Licensed User
Longtime User
When I compile my test my code in Debug (rapid) everything works fine

When I compile with Release I get the following error:

** Activity (main) Pause, UserClosed = false **
** Activity (game) Create, isFirst = true **
game_activity_create (java line: 324)

java.lang.RuntimeException: java.lang.RuntimeException: Field btn_high was declared with the wrong type.
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:157)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:204)
at bowling.stats.game._activity_create(game.java:324)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at bowling.stats.game.afterFirstLayout(game.java:98)
at bowling.stats.game.access$100(game.java:16)
at bowling.stats.game$WaitForLayout.run(game.java:76)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Field btn_high was declared with the wrong type.
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:287)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:312)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:131)
... 17 more
java.lang.RuntimeException: java.lang.RuntimeException: Field btn_high was declared with the wrong type.

** Activity (main) Create, isFirst = true **
** Activity (main) Resume **


The btn_high was entered from Designer as a RadioButton

Dim Btn_High As RadioButton


I have 3 other buttons just like the above that it says nothing about (not sure if it failed before getting to them)

NOT sure how to even go about debugging or fixing this.

A little help please.


AGAIN works fine in debug mode this is ONLY a release mode problem
 

LucaMs

Expert
Licensed User
Longtime User
And the error message says : Field btn_high was declared with the wrong type.
That's why I asked the question !
Without seeing the code nor the layouts we can only try to guess what happens.

(I hope google translate works well) ....

If you're right, you have to worry, because in that case, I'm going to ask my future questions directly to you :)

(It seems to me the exact translation)
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Figured it out.

Turns out I changed the Buttons from RadioButtons to ToggleButtons and NEVER had Designer regenerate the Dim statements.

NOT sure why the code works in DEBUG mode but NOT in Release but in any case Declared with the wrong type was the right message.
 
Upvote 0
Top