Open proncerof opened 6 years ago
Hey @ronce96 Are you still having this problem? Sorry for the too late reply, for some reason the GH did not me notified about that.
Hi! @ronce96 did you solve id? I'm facing the same exception, after I upgrade firebase versions and migrate to androidx lib!
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/String;)V in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /data/app/<app_id>-YWqXXs5LyCG-3skvD41NvQ==/base.apk:classes4.dex)
at org.jboss.aerogear.android.unifiedpush.fcm.AeroGearFCMPushRegistrar$4.doInBackground(AeroGearFCMPushRegistrar.java:193)
at org.jboss.aerogear.android.unifiedpush.fcm.AeroGearFCMPushRegistrar$4.doInBackground(AeroGearFCMPushRegistrar.java:135)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
@pcsantana Maybe the problem is because the AeroGear SDK is not using AndroidX yet. Do you have the same problem only updating the Firebase dependency?
Yes, since the com.google.firebase:firebase-messaging:17.+
, without androidx.
@pcsantana I will try to take a look at this at the weekend.
Maybe I found the reason. As the release notes says in Cloud Messaging session:
The methods
subscribeToTopic()
andunsubscribeFromTopic()
on FirebaseMessaging now return a Task that can be used to see when the request has completed.
Before, was just a sync method called in AeroGearFCMPushRegistrar class.
Well... maybe you can help me @danielpassos ! Actually, I am using the aerogear-cordova-push.
Looking for the dependencies, I found that the aerogear-android-push dependence is too old. So, I tried to update to the latest one, and the bug I reported before was gone, no errors when register! But now I have another problem. When I send a push notification, throws the following error:
java.lang.RuntimeException: Unable to instantiate service org.jboss.aerogear.android.unifiedpush.fcm.AeroGearFCMMessageReceiver: java.lang.ClassNotFoundException: Didn't find class "org.jboss.aerogear.android.unifiedpush.fcm.AeroGearFCMMessageReceiver" on path: DexPathList[[zip file "/data/app/<package>-2/base.apk"],nativeLibraryDirectories=[/data/app/<package>-2/lib/arm, /data/app/<package>-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3168)
at android.app.ActivityThread.-wrap5(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1563)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jboss.aerogear.android.unifiedpush.fcm.AeroGearFCMMessageReceiver" on path: DexPathList[[zip file "/data/app/<package>-2/base.apk"],nativeLibraryDirectories=[/data/app/<package>-2/lib/arm, /data/app/<package>-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3165)
at android.app.ActivityThread.-wrap5(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1563)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Any advice? Should I open an issue in aerogear-cordova-push repo?
Thanks in advance!
Expected Behavior
Be able to receive push notification in my Android app.
Actual Behavior
When I finish the instructions in https://aerogear.org/docs/unifiedpush/aerogear-push-android/guides/#android-app I get this error.
After looking for the error I found that I should add the following lines: build.gradle (App)
build.gradle (Project)
But I get this new error
Specifications