UrbanAirship app crashes upon receipt of message - android

Working on upgrading my UrbanAirship to 7.2. No compilation errors and the app runs fine until it receives a push message. At that point, it crashes with the following stack trace:
UALib: ManifestUtils - Unable to find class:
com.urbanairship.push.GCMPushReceiver
java.lang.ClassNotFoundException:
com.urbanairship.push.GCMPushReceiver
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at java.lang.Class.forName(Class.java:285)
at
com.urbanairship.util.ManifestUtils.validateManifest(ManifestUtils.java:215)
at com.urbanairship.UAirship.validateManifest(UAirship.java:736)
at com.urbanairship.UAirship.executeTakeOff(UAirship.java:343)
at com.urbanairship.UAirship.access$000(UAirship.java:42)
at com.urbanairship.UAirship$2.run(UAirship.java:299)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class
"com.urbanairship.push.GCMPushReceiver" on path: DexPathList[[zip file
"/data/app/com.xxx-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx-1/lib/arm,
/data/app/com.xxx-1/base.apk!/lib/armeabi-v7a, /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 java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:324) 
at java.lang.Class.forName(Class.java:285) 
at
com.urbanairship.util.ManifestUtils.validateManifest(ManifestUtils.java:215) 
at com.urbanairship.UAirship.validateManifest(UAirship.java:736) 
at com.urbanairship.UAirship.executeTakeOff(UAirship.java:343) 
at com.urbanairship.UAirship.access$000(UAirship.java:42) 
at com.urbanairship.UAirship$2.run(UAirship.java:299) 
at java.lang.Thread.run(Thread.java:818) 
Suppressed: java.lang.ClassNotFoundException:
com.urbanairship.push.GCMPushReceiver
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)
... 10 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the
boot class loader; no stack trace available
When I check to see if the class is visible (Cmd-O) and start typing, the class comes up immediately.
Has anyone encountered this? I have no idea how to fix it. Thanks.

We renamed GCMPushReceiver to GcmPushReceiver. You should remove all the Urban Airship receivers, services, and activities from your manifest and let auto manifest integration merge them for you.

Related

Error: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.firestore.local.SQLiteSchema

I got the below error when running on a physical android API 24:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/base/CharMatcher;
at com.google.common.base.Splitter.on(Splitter.java:125)
at io.grpc.internal.GrpcUtil.<clinit>(GrpcUtil.java:203)
at io.grpc.internal.AbstractManagedChannelImplBuilder.<clinit>(AbstractManagedChannelImplBuilder.java:84)
at io.grpc.okhttp.OkHttpChannelBuilder.forTarget(OkHttpChannelBuilder.java:119)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:48)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:27)
at io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java:73)
at com.google.firebase.firestore.remote.GrpcCallProvider.initChannel(com.google.firebase:firebase-firestore##21.1.1:92)
at com.google.firebase.firestore.remote.GrpcCallProvider.lambda$new$0(com.google.firebase:firebase-firestore##21.1.1:62)
at com.google.firebase.firestore.remote.GrpcCallProvider$$Lambda$1.call(com.google.firebase:firebase-firestore##21.1.1)
at com.google.android.gms.tasks.zzv.run(Unknown Source)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.lambda$execute$0(com.google.firebase:firebase-firestore##21.1.1:54)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor$$Lambda$1.run(com.google.firebase:firebase-firestore##21.1.1)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.common.base.CharMatcher" on path: DexPathList[[zip file "/data/app/com.byte_artisan.mchat2-1/base.apk"],nativeLibraryDirectories=[/data/app/com.byte_artisan.mchat2-1/lib/arm, /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 com.google.common.base.Splitter.on(Splitter.java:125) 
at io.grpc.internal.GrpcUtil.<clinit>(GrpcUtil.java:203) 
at io.grpc.internal.AbstractManagedChannelImplBuilder.<clinit>(AbstractManagedChannelImplBuilder.java:84) 
at io.grpc.okhttp.OkHttpChannelBuilder.forTarget(OkHttpChannelBuilder.java:119) 
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:48) 
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:27) 
at io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java:73) 
at com.google.firebase.firestore.remote.GrpcCallProvider.initChannel(com.google.firebase:firebase-firestore##21.1.1:92) 
at com.google.firebase.firestore.remote.GrpcCallProvider.lambda$new$0(com.google.firebase:firebase-firestore##21.1.1:62) 
at com.google.firebase.firestore.remote.GrpcCallProvider$$Lambda$1.call(com.google.firebase:firebase-firestore##21.1.1) 
at com.google.android.gms.tasks.zzv.run(Unknown Source) 
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.lambda$execute$0(com.google.firebase:firebase-firestore##21.1.1:54) 
at com.google.firebase.firestore.util.ThrottledForwardingExecutor$$Lambda$1.run(com.google.firebase:firebase-firestore##21.1.1) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
at java.lang.Thread.run(Thread.java:818) 
Suppressed: java.lang.NoClassDefFoundError: com.google.common.base.CharMatcher
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:226)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
at dalvik.system.DexPathList.findClass(DexPathList.java:321)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
... 18 more
Suppressed: java.lang.ClassNotFoundException: com.google.common.base.CharMatcher
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)
... 17 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Observing the stack, the error seems to come from firestore initialization.
The error start to pop after recent updates of firebase libraries, can´t precise with one or witch version. Also the app starts well in recent versions of Android.
The problem was a conflict with guava library, according to this long post on github.
To fix i needed to change the guava version from '28.0-jre' to '28.0-android', like this:
implementation group: 'com.google.guava', name: 'guava', version: '28.1-android'
Hope can save someone a few hours.

Play-services-ads 18.0.0 get crash

i have updated ads to:
com.google.android.gms:play-services-ads:18.0.0
and get a lot of crash from users.
Stack trace:
java.lang.RuntimeException: Unable to instantiate receiver com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" on path: DexPathList[[zip file "/data/app/base.apk"],nativeLibraryDirectories=[/data/app/lib/arm64, /vendor/lib64, /system/lib64]]
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2884)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1565)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" on path: DexPathList[[zip file "/data/app/base.apk"],nativeLibraryDirectories=[/data/app/lib/arm64, /vendor/lib64, /system/lib64]]
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.ActivityThread.handleReceiver(ActivityThread.java:2879)
... 8 more
Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver
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)
... 10 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Any one the same?
edit: i have enabled multidex, but i downgrade to 17.2.1 it's seem oke for now. But 18.0.0 not work
I had yesterday the same issue, I went crazy looking for a solution. For me it worked downgrading play services from 18.0.0 to 17.2.1.
It seems to be an error in that library. My error occurred when users downloaded the application and this, crash at the beginning but then it works well if you get in again.
Change logs of google:
To avoid a crash that occurs on first launch after app install from the play store, this release requires publishers to declare additional dependencies in their build.gradle:
com.google.android.gms:play-services-measurement:17.0.0
com.google.android.gms:play-services-measurement-sdk:17.0.0
This issue has been resolved in 18.1.0. Please see the release notes for more information: https://developers.google.com/admob/android/rel-notes
Use together:
implementation 'com.google.android.gms:play-services-measurement:17.0.0'
implementation 'com.google.android.gms:play-services-ads:18.0.0'

The Firebase implementation within an AAR I'm using causes my App to crash

I had been contacted to put a new library in the form of an AAR into my application. It worked fine before adding this AAR, but after that, every time I start it up, it crashes with the following stacktrace:
09-10 21:10:55.272 10354-10354/? W/System.err: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/tasks/TaskCompletionSource;
at com.google.firebase.remoteconfig.FirebaseRemoteConfig.zza(Unknown Source)
at com.google.firebase.remoteconfig.FirebaseRemoteConfig.fetch(Unknown Source)
at com.picmix.mobile.activity.SplashActivity.onCreate(SplashActivity.java:89)
at android.app.Activity.performCreate(Activity.java:6093)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2458)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.access$1000(ActivityThread.java:164)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1462)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:160)
at android.app.ActivityThread.main(ActivityThread.java:5541)
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:964)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.tasks.TaskCompletionSource" on path: DexPathList[[zip file "/data/app/com.picmix.mobile-2/base.apk"],nativeLibraryDirectories=[/data/app/com.picmix.mobile-2/lib/arm, /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)
... 16 more
Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.tasks.TaskCompletionSource
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)
... 17 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
From my experience, this kind of error is because I hadn't enabled MultiDex support. The strange thing is that I have it enabled, my gradle file contains the following line:
compile 'com.android.support:multidex:1.0.3'
The application I use in the manifest extends MultiDexApplication instead of just Application.
So is it something with that AAR?

Why the unsigned application does not find the Application class?

The application that I am developing is crashing in some mobiles when it is not signed. When I sign the application, it works perfectly on the same devices that previously made the application crashes.
The error is:
Process: com.my.application, PID: 10293 java.lang.RuntimeException: Unable to instantiate application com.my.application.di.base.App: java.lang.ClassNotFoundException: Didn't find class "com.my.application.di.base.App" on path: DexPathList[[zip file "/data/app/com.my.application-1/base.apk"],nativeLibraryDirectories=[/data/app/com.my.application-1/lib/arm, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4526)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.my.application.di.base.App" on path: DexPathList[[zip file "/data/app/com.my.application-1/base.apk"],nativeLibraryDirectories=[/data/app/com.my.application-1/lib/arm, /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:980)
at android.app.LoadedApk.makeApplication(LoadedApk.java:558)
... 10 more
Suppressed: java.lang.ClassNotFoundException: com.my.application.di.base.App
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
I'm not obfuscating my code, nor use instant run. I'm using multidex.
For creating debug apk create it from Build>Build APK. The issue you are facing is because of instant run.
Do you use proguard or any other method to obfuscate your code?
I think you should use multidex

APK doesn't work on phone but App works normal in Android Studio

I have an App that works without problems in Android Studio, but when I Build the apk and then install it shows stranges behaviors:
1- When App is installing, phone shows me notification that no one permission is necessary for my app (and that is not true, my app works with awareness)
2- After installation, and running, the App crushed, no one screen is showed.
I was thinking that maybe could be a problem with manifest, but as I said in emulator works without problem. First time I see this behavoir. Any idea how to solve it ??
03-28 13:15:22.851 7334-7334/com.itelma.tele D/AndroidRuntime: Shutting down VM
03-28 13:15:22.851 7334-7334/com.itelma.tele E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.itelma.tele, PID: 7334
java.lang.RuntimeException: Unable to instantiate service com.itelma.tele.API_AC.FCMInstanceIdService: java.lang.ClassNotFoundException: Didn't find class "com.itelma.tele.API_AC.FCMInstanceIdService" on path: DexPathList[[zip file "/data/app/com.itelma.tele-2/base.apk"],nativeLibraryDirectories=[/data/app/com.itelma.tele-2/lib/arm, /data/app/com.itelma.tele-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3841)
at android.app.ActivityThread.access$2100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1909)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.itelma.tele.API_AC.FCMInstanceIdService" on path: DexPathList[[zip file "/data/app/com.itelma.tele-2/base.apk"],nativeLibraryDirectories=[/data/app/com.itelma.tele-2/lib/arm, /data/app/com.itelma.tele-2/base.apk!/lib/armeabi-v7a, /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.ActivityThread.handleCreateService(ActivityThread.java:3838)
at android.app.ActivityThread.access$2100(ActivityThread.java:229) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1909) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:7325) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
Suppressed: java.lang.ClassNotFoundException: com.itelma.tele.API_AC.FCMInstanceIdService
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)
... 10 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

Categories

Resources