Android Question java.lang.RuntimeException: Field: _button2 not found in: b4a.example.main

Martincg

Member
Licensed User
I can compile my project OK but when I try to run it on a phone I get this-

Error occurred on line: 38 (Main)
java.lang.RuntimeException: Field: _button2 not found in: b4a.example.main

Line 38 in my in file is empty but line 39 is

Sub Activity_Create(FirstTime As Boolean)

I had a button2 in my design and had the same error and after trying various things I have now deleted the button2, ensured that there is no reference to button2 in the design scripts or in my Main file (no other files) but can't stop the error. The script still runs though.
I don't understand the reference in the error message to b4a.example.main which is not the name of my project.
There is probably something simple I don't get, can someone please give me a clue?
 

Martincg

Member
Licensed User
Don't understand but I decided to try putting the button back and now the error message has gone.
 
Top