defold / extension-push

This is a Defold native extension which provides access to Push Notifications functionality on iOs and Android devices.
https://www.defold.com/extension-push/
MIT License
20 stars 16 forks source link

Crash on Android #28

Closed AGulev closed 3 years ago

AGulev commented 3 years ago

App crashes on Android when receive a local push notification

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/R$dimen;
    at androidx.core.app.NotificationCompat$Builder.reduceLargeIconSize(NotificationCompat.java:996)
    at androidx.core.app.NotificationCompat$Builder.setLargeIcon(NotificationCompat.java:982)
    at com.defold.push.LocalNotificationReceiver.onReceive(LocalNotificationReceiver.java:82)
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:2935)
    at android.app.ActivityThread.access$2000(ActivityThread.java:178)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1594)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loop(Looper.java:207)
    at android.app.ActivityThread.main(ActivityThread.java:5845)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:768)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.R$dimen" on path: DexPathList[[zip file "/data/app/com.bringmecakes-1/base.apk"],nativeLibraryDirectories=[/data/app/com.bringmecakes-1/lib/arm64, /data/app/com.bringmecakes-1/base.apk!/lib/arm64-v8a, /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)
    ... 12 more
    Suppressed: java.lang.ClassNotFoundException: androidx.core.R$dimen
        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 trace available
AGulev commented 3 years ago

@britzl The only related thing I found is this post https://stackoverflow.com/questions/52696574/didnt-find-class-androidx-core-content-fileprovider

It's possible that we need to update multidex in Defold itself for using androidx.multidex. But again, not sure if it's related.

britzl commented 3 years ago

Hmm, I think maybe we need to change from com.android.support to androidx.core here:

https://github.com/defold/extension-push/blob/master/extension-push/ext.manifest#L6

AGulev commented 3 years ago

maaaaybe, I'll try a bit later

AGulev commented 3 years ago

PR https://github.com/defold/extension-push/pull/29