New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android 13 Crash #1083
Comments
Same is happening for me. |
After reviewing the documents changes in Android 13, I see nothing announced that might cause the problem. This appears to be a bug in Android 13. In ActivityThread.java:4524 (inside handleCreateService) there is a call to xxxxx.toString() when xxxx is null, thereby causing a crash. Unfortunately Android 13 source is not available. If I look at the latest version of that ActivityThread.java the lines don't match up: However, I do see a number of string concatenations that would cause a toString() call like this: Could data.info.name be unexpectedly null? This should come from the android:name element of the XML declaration of the BeaconService, which is declared in the library AndroidManifest.xml file as:
But maybe something in Android 13 causes this to become null later on? You might try two things:
|
I have the same issue. I checked the merged manifest and I do have |
@FabienWitick can you please share your full merged manifest declaration in case that gives any clues? @DarrenMiddleton , did you try the suggestion you posted? I wouldn't think the |
Here is my full merged manifest :
` |
I am experiencing the same thing.
|
After checking the library code and debugging process, I figured that |
@tonynguyen0523 and @FabienWitick, please note that what you two describe has a different stack trace than the one in the issue that opened this question, so I am not certain it is the same issue. @DarrenMiddleton, can you please try this same workaround to see if it solves the problem for your stack trace as well? Just add this to your app's AndroidManifest.xml:
Run the app, and report back whether your crash goes away. |
@davidgyoung I think this is the same stack trace. The stack posted by @tonynguyen0523 is the cause of the |
Here's a candidate fix: #1095. I am putting this into a beta release now, 2.19.5-beta7. If anyone on this thread with an Android 13 install handy can try that library version and confirm if the crash goes away, I would appreciate it. The fix looks pretty straightforward. It will take about an hour for the beta release to show up on Maven central. |
2.19.5-beta7 is now available on Maven Central. |
Just tried 2.19.5-beta7, it seems to work for me. Thank you for this new build @davidgyoung. Do you think we can use this version for production? Or do we stick to this fix? |
OK, thanks for the confirmation, @FabienWitick. I will merge this in and it will be included in the next non-beta release as well. |
When I start ranging for Bluetooth devices using the altbeacon library I get the following crash.
java.lang.RuntimeException: Unable to create service org.altbeacon.beacon.service.BeaconService: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference at android.app.ActivityThread.handleCreateService(ActivityThread.java:4524) at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2153) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7850) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
It happens on all Android devices I have tested that are running Android 13. The altbeacon library version is 2.19.
The text was updated successfully, but these errors were encountered: