AltBeacon library - how to use in remote service - android

I am trying to use the AltBeacon library with the ranging feature in a remote service. However, I could not manage to get the beacon detection running successfully by now. When declaring the same service as local service everything works fine.
When the service runs in its own process the function startRangingBeaconsInRegion() seems to throw the following exception:
09-17 17:09:14.643 10709-10729/com.my.project E/Parcel﹕ Class not found when unmarshalling: org.altbeacon.beacon.service.StartRMData
java.lang.ClassNotFoundException: org.altbeacon.beacon.service.StartRMData
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at android.os.Parcel.readParcelableCreator(Parcel.java:2281)
at android.os.Parcel.readParcelable(Parcel.java:2245)
at android.os.Message.readFromParcel(Message.java:571)
at android.os.Message.access$000(Message.java:32)
at android.os.Message$1.createFromParcel(Message.java:527)
at android.os.Message$1.createFromParcel(Message.java:524)
at android.os.IMessenger$Stub.onTransact(IMessenger.java:51)
at android.os.Binder.execTransact(Binder.java:446)
Caused by: java.lang.ClassNotFoundException: org.altbeacon.beacon.service.StartRMData
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:309)
            at android.os.Parcel.readParcelableCreator(Parcel.java:2281)
            at android.os.Parcel.readParcelable(Parcel.java:2245)
            at android.os.Message.readFromParcel(Message.java:571)
            at android.os.Message.access$000(Message.java:32)
            at android.os.Message$1.createFromParcel(Message.java:527)
            at android.os.Message$1.createFromParcel(Message.java:524)
            at android.os.IMessenger$Stub.onTransact(IMessenger.java:51)
            at android.os.Binder.execTransact(Binder.java:446)
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
09-17 17:09:14.643 10709-10729/com.my.project W/Binder﹕ Caught a RuntimeException from the binder stub implementation.
android.os.BadParcelableException: ClassNotFoundException when unmarshalling: org.altbeacon.beacon.service.StartRMData
at android.os.Parcel.readParcelableCreator(Parcel.java:2295)
at android.os.Parcel.readParcelable(Parcel.java:2245)
at android.os.Message.readFromParcel(Message.java:571)
at android.os.Message.access$000(Message.java:32)
at android.os.Message$1.createFromParcel(Message.java:527)
at android.os.Message$1.createFromParcel(Message.java:524)
at android.os.IMessenger$Stub.onTransact(IMessenger.java:51)
at android.os.Binder.execTransact(Binder.java:446)
Is there any solution for this problem?

The Android Beacon Library is not designed to be run in its own process, so what you describe is not possible. You can see a more detailed discussion of why this is true in this issue discussion here: https://github.com/AltBeacon/android-beacon-library/issues/291

This is an old discussion, but as I found it now, I will post my solution. If you always want your Beacon Service to run in its own process, and therefore you need the altBeacon service to run in same process, it is very doable. Just have your service create the BeaconManager and add the following to your Manifest:
<!-- This is our own BeaconService. We run it in own process, as we don't want it affecting UI, and better crash control.
This also solves the ACRA issue. -->
<service android:name=".BeaconControllerService"
android:process=":my.BeaconControllerService"
android:exported="false"
android:enabled="true">
</service>
<!-- Override beacon library. Set it to our process -->
<receiver android:name="org.altbeacon.beacon.startup.StartupBroadcastReceiver"
android:process=":my.BeaconControllerService"
tools:replace="process" />
<service
android:name="org.altbeacon.beacon.service.BeaconService"
android:process=":my.BeaconControllerService"
tools:replace="process" />
<service
android:name="org.altbeacon.beacon.BeaconIntentProcessor"
android:process=":my.BeaconControllerService"
tools:replace="process" />
So far it is working for me. This should also solves the ACRA issue. Just remember, as its running in own process, if you want to bind from your application to your Service, you will have to use the Message class or an AIDL binder. See Android docs for info. Also, the BeaconManager has to be in your Service class, not your application.

Related

Android In App billing fails with repsonse code 6

I'm using the Billing Manager provided in googlesamples to handle in app purchases in my android app. Everything seems to work until I click buy and am greeted with the error message:
The Transaction could not be completed.
From the logs I can see that I am getting a response code 6 ("Fatal error during the API action") back from the server. Additionally I can see two suspicious errors during the purchasing process:
E/DatabaseUtils: Writing exception to parcel
java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:15168)
at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2492)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:688)
at android.content.ContentProvider$Transport.call(ContentProvider.java:325)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:275)
at android.os.Binder.execTransact(Binder.java:404)
at dalvik.system.NativeStart.run(Native Method)
E/Parcel: Class not found when unmarshalling: com.google.android.finsky.billing.common.PurchaseParams
java.lang.ClassNotFoundException: com.google.android.finsky.billing.common.PurchaseParams
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at java.lang.Class.forName(Class.java:216)
at android.os.Parcel.readParcelableCreator(Parcel.java:2140)
at android.os.Parcel.readParcelable(Parcel.java:2104)
at android.os.Parcel.readValue(Parcel.java:2020)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2321)
at android.os.Bundle.unparcel(Bundle.java:249)
at android.os.Bundle.getString(Bundle.java:1118)
at android.content.Intent.getStringExtra(Intent.java:5151)
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1468)
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1063)
at com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:4385)
at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:254)
at com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:4266)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:260)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2712)
at android.os.Binder.execTransact(Binder.java:404)
at dalvik.system.NativeStart.run(Native Method)
Caused by: java.lang.NoClassDefFoundError: com/google/android/finsky/billing/common/PurchaseParams
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:251) 
at java.lang.Class.forName(Class.java:216) 
at android.os.Parcel.readParcelableCreator(Parcel.java:2140) 
at android.os.Parcel.readParcelable(Parcel.java:2104) 
at android.os.Parcel.readValue(Parcel.java:2020) 
at android.os.Parcel.readArrayMapInternal(Parcel.java:2321) 
at android.os.Bundle.unparcel(Bundle.java:249) 
at android.os.Bundle.getString(Bundle.java:1118) 
at android.content.Intent.getStringExtra(Intent.java:5151) 
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1468) 
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1063) 
at com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:4385) 
at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:254) 
at com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:4266) 
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:260) 
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2712) 
at android.os.Binder.execTransact(Binder.java:404) 
at dalvik.system.NativeStart.run(Native Method) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.finsky.billing.common.PurchaseParams" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:251) 
at java.lang.Class.forName(Class.java:216) 
at android.os.Parcel.readParcelableCreator(Parcel.java:2140) 
at android.os.Parcel.readParcelable(Parcel.java:2104) 
at android.os.Parcel.readValue(Parcel.java:2020) 
at android.os.Parcel.readArrayMapInternal(Parcel.java:2321) 
at android.os.Bundle.unparcel(Bundle.java:249) 
at android.os.Bundle.getString(Bundle.java:1118) 
at android.content.Intent.getStringExtra(Intent.java:5151) 
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1468) 
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1063) 
at com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:4385) 
at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:254) 
at com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:4266) 
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:260) 
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2712) 
at android.os.Binder.execTransact(Binder.java:404) 
at dalvik.system.NativeStart.run(Native Method) 
However I am not sure that there is a connection between the errors and the failing of the purchase.
Any idea where I went wrong?
Try the solution from this github forum:
Fixed bug w/ null vs. empty payload:
Changes Proposed in this pull request:
Promote null payloads to string.Empty to prevent confusion between the two. Empty payload strings get deserialized as null causing it to
appear as though the purchase failed.
Initialize tcsPurchase earlier to prevent a possible race condition.
The said bug was first discussed here.

Using Java reflection mechanism from within a JAR on Android

In my AndroidStudio project I want to use a JAR library that uses reflection mechanism to dynamically load a class and run its methods.
However, it fails to load the class and I'm getting the ClassNotFoundException.
When I try to load the class from within an activity -- it works.
It only fails when the system tries to load the class from within the library.
What is more, the library cannot load classes that are with the library, resulting in the same error.
Furthermore, I cannot load the classes from the library, even from the activity.
The class is loaded as follows:
Class<?> actionClass = Class.forName(callbackClass,true,ClassLoader.getSystemClassLoader());
The exception thrown looks as follows:
java.lang.ClassNotFoundException: demos.callbacks.GetDayOfAWeekCallback
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at com.example.tomek.test1.MainActivity.buttonOnClick(MainActivity.java:38)
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "demos.callbacks.GetDayOfAWeekCallback" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 14 more
Suppressed: java.lang.ClassNotFoundException: demos.callbacks.GetDayOfAWeekCallback
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
OK, I have figured it out.
The problem was in using getSystemClassLoader.
Instead:
Class<?> actionClass = Class.forName(className,true,ClassLoader.getSystemClassLoader());
I used
Class<?> actionClass = Class.forName(className);
And it worked.
However it is still not perfectly clear to me why both of these methods works in desktop environment, and only the second one works in Android.
it's clear cause you use the jar ClassLoader which doesn't contain the class that you want to load. So to resolve this, you have to call your app ClassLoader.

New 'Hello World' app fails with classNotFound for MainActivity

I have found several posts regarding classNotFound for MainActivity but all seem to be related to differences in libraries between the main app and support libraries, stuff like that. I have a situation where I am simply creating a new application in Android Studio and with zero modifications, running the helo world default app, fails with this error.
07-20 23:25:46.012 7152-7152/com.rythmair.lvlvalidation D/AndroidRuntime: Shutting down VM
07-20 23:25:46.012 7152-7152/com.rythmair.lvlvalidation E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.rythmair.lvlvalidation, PID: 7152
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.rythmair.lvlvalidation/com.rythmair.lvlvalidation.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.rythmair.lvlvalidation.MainActivity" on path: DexPathList[[zip file "/data/app/com.rythmair.lvlvalidation-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2968)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3233)
at android.app.ActivityThread.access$1000(ActivityThread.java:197)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6873)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.rythmair.lvlvalidation.MainActivity" on path: DexPathList[[zip file "/data/app/com.rythmair.lvlvalidation-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2958)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3233) 
at android.app.ActivityThread.access$1000(ActivityThread.java:197) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:145) 
at android.app.ActivityThread.main(ActivityThread.java:6873) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 
Suppressed: java.lang.ClassNotFoundException: com.rythmair.lvlvalidation.MainActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
07-20 23:26:13.377 7152-7152/com.rythmair.lvlvalidation I/Process: Sending signal. PID: 7152 SIG: 9
Not sure what I am missing here.
Try putting this in your manifest if it is not there
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This was an odd one, given the error. The issue turned out to be access rights on the device I was testing (I think). I caught in one part of the stack that it couldn't write code to data/data/... Upon digging in a bit further, I found that I was signed in on my tablet as a test user that I use to validate licensing functionality. While logged in as this user, it would fail any time I tried to build the app with the error shown above. Once I signed back in on my tablet as myself, this issue no longer occurs.

How to resolve ClassNotFoundException in Android Studio

I have recently migrated my project from Eclipse to Android Studio. Earlier everything was working perfectly, but recently when I started working on it again I am not able to launch the application. Its always showing me the same error. I haven't changed anything on application level, still getting the same result. Here is the log I am getting
FATAL EXCEPTION: main
Process: com.example.android, PID: 6977
java.lang.RuntimeException: Unable to instantiate application com.example.android.MobApplication: java.lang.ClassNotFoundException: Didn't find class "com.example.android.MobApplication" on path: DexPathList[[zip file "/data/app/com.example.android-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:601)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4919)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5721)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.android.MobApplication" on path: DexPathList[[zip file "/data/app/com.example.android-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newApplication(Instrumentation.java:986)
at android.app.LoadedApk.makeApplication(LoadedApk.java:587)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4919)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5721)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Suppressed: java.lang.ClassNotFoundException: com.example.android.MobApplication
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
As I have recently switched my IDE I am facing problems to solve this one. I have also tried the other answers but still unable to solve this error. Kindly help me with this so I can proceed with my project.
Any help would be appreciable.
Thanks
This might be the 65k methods limit. Try to use the solutions in the link.
Edit: For others who stumble this issue - #Salman Khan added multiDexEnabled true to the gradle file (as written in the link) and it solved the problem. It would be still better to read the whole article and follow the steps there.
Replaced lambda with anonymous class:
java.lang.ClassNotFoundException happened in my android studio project in two classes – in both of them there was lambda expressions. After I replaced lambda with anonymous class – the build was successful.
In my case, I needed to edit from:
String id = MyClass.class.toString();
Into:
String id = MyClass.class.getName();
Because .toString() returns something like "class mypackage.MyClass" (instead of "mypackage.MyClass").

What are the consequences of not fixing "Class not found when unmarshalling" issue? and why does it not affect the app?

I'm working on updating an existing app to Marshmallow, and have just noticed there is this message in logcat when the app launches:
E/Parcel﹕ Class not found when unmarshalling: com.redacted.TheClass
java.lang.ClassNotFoundException: com.redacted.TheClass.
It only occurs on Samsung devices, not LG nor Motorola.
After more investigation I found the problem is also present in Lollipop and thus is present in a shipped version of the app.
However, despite it being an exception it appears to be having no detrimental effect - the app passed testing on Lollipop and is functioning as intended on L and M builds.
Therefore I'd like to find out if there are any consequences to not fixing this problem? Is the app functioning properly despite this exception chance, and if some sands get shifted elsewhere it might stop working?
Why not fix it ??!! You are all jumping up and down to ask. The reason is the app is not available on the app store, it is pre-installed into devices' roms and distributing a new .apk to device manufacturers would delay their Marshmallow roms building schedule. Therefore I do not want to create a new .apk unless there is a potential that the app could stop working, even though its been working fine with this issue.
In other words, I'll like to know in depth what causes this error message, but more particularly why it is that the app continues to function despite their being an OS level exception.
The full stack trace is:
11-24 09:03:43.065 3641-5600/? E/Parcel﹕ Class not found when unmarshalling: com.redacted.TheClass
java.lang.ClassNotFoundException: com.redacted.TheClass
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at android.os.Parcel.readParcelableCreator(Parcel.java:2383)
at android.os.Parcel.readParcelable(Parcel.java:2337)
at android.os.Parcel.readValue(Parcel.java:2243)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2592)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getString(BaseBundle.java:920)
at android.content.Intent.getStringExtra(Intent.java:6171)
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:2688)
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:2127)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6151)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:5928)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:170)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3836)
at android.os.Binder.execTransact(Binder.java:453)
Caused by: java.lang.ClassNotFoundException: com.cequint.cityid.CityIdResponse
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:324)
            at android.os.Parcel.readParcelableCreator(Parcel.java:2383)
            at android.os.Parcel.readParcelable(Parcel.java:2337)
            at android.os.Parcel.readValue(Parcel.java:2243)
            at android.os.Parcel.readArrayMapInternal(Parcel.java:2592)
            at android.os.BaseBundle.unparcel(BaseBundle.java:221)
            at android.os.BaseBundle.getString(BaseBundle.java:920)
            at android.content.Intent.getStringExtra(Intent.java:6171)
            at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:2688)
            at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:2127)
            at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6151)
            at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:5928)
            at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:170)
            at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3836)
            at android.os.Binder.execTransact(Binder.java:453)
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
The class inherits from Parcelable and is used to store several ints, booleans and Strings along with an activity (declared as Class).
When a state machine wants to switch to a new activity it creates an instance of this class and sets the activity then passes it to a method as a parameter. The method then uses the class to create an intent to launch the activity.

Categories

Resources