-
Notifications
You must be signed in to change notification settings - Fork 836
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
Getting ClassNotFoundException org.altbeacon.beacon.service.StartMRData #306
Comments
Strange. The StartRMData class is used when you start ranging/and or monitoring to move data between the BeaconManager and the service. A few questions:
|
I tested by opening the app with both ble scanning ON and OFF at the time of start, but I can see the same message in the logcat. It has this additional error as well, if helpful. W/Binder: Caught a RuntimeException from the binder stub implementation. |
Do you have a custom service definition in your AndroidManifest.xml for the BeaconService? |
No. My app's AndroidManifest has definitions of application, my own custom services (IntentService) and activities. Nothing related to BeaconService. |
Sorry, I don't see any obvious causes of this issue. I am closing this due to inactivity and the fact that I cannot reproduce the issue. If you need further help with this, please reopen. |
This happens to me as well. I do have my own service that runs in the background to synchronize data but nothing to do with beacons. I'm led to believe it somehow interferes with these. My stacktrace:
|
Since both reported cases of this are with a second custom service, it seems reasonable to suspect it is related to adding the other service. Perhaps we could try to reproduce with the library's reference application by adding a similar additional service. This might help track it down |
Mine is just a simple IntentService which gets some data over network and On Wed, 24 Feb 2016 at 17:42 David G. Young [email protected]
|
It seems to occur when I start monitoring for a UUID:
|
When you start monitoring, the BeaconManager communicates with the library's scanning service, passing it serialized information about what region you want to monitor in the |
I also get the same issue, or related. I have implemented a beacon monitor that monitors a region and ranges beacons in that region upon entering a region. When I start my app and do a call to ContentResolver.requestSync(Account account, String authority, Bundle extras) (only the first call), I get the error log shown below:
Edit: Note that I haven't found that anything is actually crashing. The beacon monitoring works good after this occurred, and before. The ContentResolver returns its response properly as well. |
It also seems like the library stops ranging for a while after this happens. On Mon, 29 Feb 2016 at 15:12 maggud [email protected] wrote:
|
AFAIK, the bug is essentially here:
Note: The |
Likely related: |
Yes, it appears that the way the beacon detection data are passed from the service to the client won't work across processes and needs to be updated to work with the service as a separate process. The original design of the library was intended to allow that, but the recommended practice and usage examples are all based on running it in the same process as the app. There are a number of other changes that have been made to the library that would not be compatible with running it as a separate service. (Mostly configuration settings on the BeaconManager singleton that expect that the same instance exist in the client and the scanning service.) Is there a reason to run the service as a separate process? If so, how are you setting up the library such that this happens? My concern is that a simple fix for this problem will simply uncover other problems, and full support for running the scanning service in a separate process would require bigger changes than described here. |
My primary motivation was that the service does a lot of work which is blocking the main thread. It would likely be a good idea to move the Service's handler off the main looper. But just putting the service on a different process was a quick fix for me. Except - it doesn't actually work :-) The only change is putting android:process=":beaconService" or similar on the service's manifest entry. |
If you see that the service is blocking the main thread, please open a separate issue with details. I don't want to derail this thread with a discussion of that, but all bluetooth callback handling is passed off to a different thread in the |
I'm getting the same thing. I have ACRA - https://github.com/ACRA/acra - in my app. If I remove ACRA the issue disappears. I have no idea why but I thought it may help the debugging process. In a very hand-wavy way ACRA appears to cause services to be run as separate processes, where they are not when ACRA is not there. |
I got this without a separate Service also only when I create a signed release apk. E/AndroidRuntime: FATAL EXCEPTION: IntentService[BeaconIntentProcessor] |
@TFreudi1, are you either:
If you are doing either of the following, it may explain why you are having this problem. If you are not doing this, please post a copy our your AndroidManifest.xml |
I dont do nothing of that 2 Points.I upload my manifest as txt file: If I switch of proguard completly the error is gone.
I work with Androidstudio 2.1 under Windows 7 no special things, with the SDK coming with the studio |
I put this in my proguard-project.txt and changed my release-configuration back: |
I`m also getting this, starts when i added the Parse Server push notification service, i also tried Firebase, but same problem, if i remove the service the applications works correctly. |
Hi!, I have the same problem, Is there a solution? Iam using google cloud messaging, If I remove gcm everything is fine |
Second time around for me with this issue on another app I am working on with uses AltBeacon. Everything was working fine until I added a required service for Nokia HERE maps and now I get the error : What's the status of this issue? I know it's been a while. |
I have not investigated this, but I think there are two paths forward, both involving the isolated-process attribute of the service declaration in the AndroidManifest.xml https://developer.android.com/guide/topics/manifest/service-element.html Here is what the service declarations look like by default:
@quitequick, I think you could easily try (1) above by simply overriding those two declarations in your own app manifest. Perhaps if you add android:isolatedProcess="false" to the BeaconIntentProcessor declaration everything will start working. (It's a dream I know!) |
I tried suggestion 1. but still get the same error. |
Sorry to hear that @quitequick. You might try suggestion 2 without any changes to the library. When running in a different process, you won't be able to use many of the library configuration options that rely on static variables, but it may work OK with the defaults. I know it is possible to get this fully working with the service running with full features as a separate process configuration, it just may be a bit time consuming. If you're lucky, you may get it working good enough for your purposes with little or no effort. |
I tried suggestion 2. Just setting android:isolatedProcess="true" causes quite a few knock-on effects. When android:isolatedProcess="false" there are no complaints about messaging the service before it's bound. When the process is isolated there are complaints. e.g. BackgroundPowerSaver does not check for the service being bound so any Activity that causes onResume etc. to be fired an attempt to set the scan period fails. Also, I imagine there is a lot code out there that would break if the behaviour changed requiring certain methods to succeed only if the service is bound. I guess it will need someone who know more about the internals of AltBeacon to look at this. But right now unless I can get a fix either AltBeacon or Nokia HERE maps will have to go - so it's a showstopper for me. |
Well, nuts. Sorry, @quitequick, I realize that this would be a showstopper for your project. I'm sure I could fix the library so the service runs successfully in a separate process, but it will certainly require more time than I can put into this in the near term as a volunteer effort. If your company can sponsor the work needed, perhaps we can work something out depending on your timeline. Feel free to contact me at [email protected], if so. |
Candidate fix is here #479 |
@ankitgupta100, @messer00, @ankitgupta100, @ClaudioINc, @TFreudi1 Can you please try out this release and see if it fixes the problems discussed above? I have prepared a binary aar file with instructions on how to add it to your project in place of the release version available on jCenter: https://github.com/AltBeacon/android-beacon-library/releases/tag/2.9.2-mpb1 |
With the latest Android 6 update (Nexus 5), I am receiving following error on debugging -
E/Parcel: Class not found when unmarshalling: org.altbeacon.beacon.service.StartRMData
E/Parcel: java.lang.ClassNotFoundException: org.altbeacon.beacon.service.StartRMData
E/Parcel: at java.lang.Class.classForName(Native Method)
E/Parcel: at java.lang.Class.forName(Class.java:324)
E/Parcel: at android.os.Parcel.readParcelableCreator(Parcel.java:2383)
E/Parcel: at android.os.Parcel.readParcelable(Parcel.java:2337)
E/Parcel: at android.os.Message.readFromParcel(Message.java:571)
E/Parcel: at android.os.Message.-wrap0(Message.java)
E/Parcel: at android.os.Message$1.createFromParcel(Message.java:527)
E/Parcel: at android.os.Message$1.createFromParcel(Message.java:525)
E/Parcel: at android.os.IMessenger$Stub.onTransact(IMessenger.java:51)
E/Parcel: at android.os.Binder.execTransact(Binder.java:453)
E/Parcel: Caused by: java.lang.ClassNotFoundException: org.altbeacon.beacon.service.StartRMData
E/Parcel: at java.lang.Class.classForName(Native Method)
E/Parcel: at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
E/Parcel: at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
E/Parcel: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
E/Parcel: at java.lang.Class.classForName(Native Method)
E/Parcel: at java.lang.Class.forName(Class.java:324)
E/Parcel: at android.os.Parcel.readParcelableCreator(Parcel.java:2383)
E/Parcel: at android.os.Parcel.readParcelable(Parcel.java:2337)
E/Parcel: at android.os.Message.readFromParcel(Message.java:571)
E/Parcel: at android.os.Message.-wrap0(Message.java)
E/Parcel: at android.os.Message$1.createFromParcel(Message.java:527)
E/Parcel: at android.os.Message$1.createFromParcel(Message.java:525)
E/Parcel: at android.os.IMessenger$Stub.onTransact(IMessenger.java:51)
E/Parcel: at android.os.Binder.execTransact(Binder.java:453)
E/Parcel: Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Any idea what it means?
The text was updated successfully, but these errors were encountered: