Android Question Error NullPointerException in release

Fausto Loss

Member
Licensed User
Hello guys.
My app has returned the error:
Java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals (java.lang.Object)' on a null object reference

But only when compiled, not in debug mode.

Originally line 1532 is the one that is highlighted in red.
I've created blank lines, but the error remains in the same place!

In debug mode it works perfectly, with no error at all.

Can anyone help?
 

Attachments

  • erro.png
    erro.png
    111.7 KB · Views: 235

Fausto Loss

Member
Licensed User
This is the java line number. It is not the same as your code line number. The correct line number only appears in debug mode.

The error happens in Activity_Create of this activity. Can you post the code?

Hi, I was just reading the issue of the line number, I had not noticed the activity_create information.
I noticed that this routine has many lines. I will divide and try to find the error.

As the error only happens in release, can not I be guided by the correct line number?

I'll write the progress of the tests here.

Thank you for the tip.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
can not I be guided by the correct line number?
Compile your app. Start the app and run till error.
Open the objects/src/ folder and look into the java-code...

If the error says line 1000. Look at line 1000 in the generated java-Code. You´ll find the B4A LineNumber there....
 
Upvote 0

Fausto Loss

Member
Licensed User
Compile your app. Start the app and run till error.
Open the objects/src/ folder and look into the java-code...

If the error says line 1000. Look at line 1000 in the generated java-Code. You´ll find the B4A LineNumber there....

Thank you for the tip !!!
 
Upvote 0

Fausto Loss

Member
Licensed User
Many, many, many thanks for the tip DonManfred and Erel. You are the best !!

Problem solved !! I was reading a field and comparing it to a string, but that field was null ...
 
Upvote 0
Top