Open ignaciolarranaga opened 7 years ago
I had to move back to 0.0.19 because I was unable to make it work with the new version (the old one works fine).
Tried also the suggestions and manually touch the version as recommended for before the hook but nothing work.
@ignaciolarranaga This https://github.com/NativeScript/push-plugin/issues/80 tells you what to remove in order to make it work, I have no idea why the Documentation says the opposite, but check the stuff I had to remove, it works great!
Thanks @Daxito, I would try again for the next release in a few days and comment back.
Hope the documentation gets fixed soon. I first updated to 1.0.0 so I think I added them my self by reading the doc :(
Hello, I'm in the same situation plugin version 0.1.2:
An uncaught Exception occurred on "main" thread. java.lang.RuntimeException: Unable to instantiate receiver com.google.android.gms.gcm.GcmReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.gcm.GcmReceiver" on path: DexPathList[[zip file "/data/app/org.nativescript.fleetbar-1/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.fleetbar-1/lib/arm, /data/app/org.nativescript.fleetbar-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]] at android.app.ActivityThread.handleReceiver(ActivityThread.java:2706) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421) at android.os.Handler.dispatchMessage(Handler.java:102) 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 "com.google.android.gms.gcm.GcmReceiver" on path: DexPathList[[zip file "/data/app/org.nativescript.fleetbar-1/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.fleetbar-1/lib/arm, /data/app/org.nativescript.fleetbar-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 android.app.ActivityThread.handleReceiver(ActivityThread.java:2701) ... 8 more Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.gcm.GcmReceiver 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
If I remove this, it works, but i can't receive notifications when app is closed:
<activity android:name="com.telerik.pushplugin.PushHandlerActivity"/>
<receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.pushApp.gcm" />
</intent-filter>
</receiver>
<service android:name="com.telerik.pushplugin.PushPlugin" android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
For the realization of an important project, I absolutely need to fix this problem. Now the error is disappeared, but still I can't receive notifications when app is closed. I've searched everywhere, but every relevant resource points to this repo.
There's now way?
I have the same error. It does not happen if It is put "outstide" of the application xml node, but then, the "release" command does not work :(
@ignaciolarranaga , do you have more luck?
@Nikoms I believe this error should not be produced in the new setup of the plugin (using Firebase). You may need to double check the docs in the README file of this repo. Please note that you may need to remove and add the Android platform to the project.
Also this issue summarized the case and the solution well.
Hope this helps.
Please follow the part in the docs (Android configuration for uisng FCM)[https://github.com/NativeScript/push-plugin/blob/master/README.md#android-configuration-for-using-firebase-cloud-messaging] and skip the previous content.
Hey @AntonDobrev thx for your kind reply. i'm working with "nativescript-push-notifications": "^0.1.2". This is the last version right?
I also remove/add platform.
I'm not using gradle deamon. Is it mandatory?
Ok,
I removed the xml :
<activity android:name="com.telerik.pushplugin.PushHandlerActivity"/>
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="com.pushApp.gcm"/>
</intent-filter>
</receiver>
<service
android:name="com.telerik.pushplugin.PushPlugin"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
And it works... And I still receive message event when the app is closed...
Is this xml necessary? Can I do a PR if it's not (To update the doc)
Thanks. That solved it for me!
I'm receiving this exception when receive a push notification. This is from the emulator (API 23) but the app also experience the same on a device:
Here is the Manifest: