Notification subscribe crash app on build 2019.3512

Currently my application is working great on the build 2018.3326. But when I build with 2019.3512, then crash app at notifications.subscribe(). Please help me!

Can you provide more details?

Share the section of code?

Share the console.log from the device (you may need to an “adb logcat” to capture it). Please use a service like pastebin.com for long logs.

Share your build.settings (again pastebin.com is your friend here if you have a long build.settings).

Thanks

Rob

I have the same issue on iOS (haven’t tested on Android), where the app crashes as soon as the notifications popup appears on the latest daily build at this time (3517), and every thing works fine on 3332. I’ll get a log as soon as I can :) 

This is my logcat error

-----------------Logcat error-------------------

--------- beginning of crash

2019-09-12 08:26:34.054 13985-13985/? E/AndroidRuntime: FATAL EXCEPTION: main

    Process: piano.tiles.duongcam, PID: 13985

    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/piano.tiles.duongcam-eBi_fd9-ZlGUHe8zntsF6w==/base.apk)

        at plugin.notifications.v2.LuaLoader$Subscribe$1.run(LuaLoader.java:352)

        at android.os.Handler.handleCallback(Handler.java:790)

        at android.os.Handler.dispatchMessage(Handler.java:99)

        at android.os.Looper.loop(Looper.java:164)

        at android.app.ActivityThread.main(ActivityThread.java:7000)

        at java.lang.reflect.Method.invoke(Native Method)

        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)

        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)


This is the code I use for notifications

main.lua

local notifications = require( "plugin.notifications.v2" ) notifications.registerForPushNotifications({useFCM=true}) notifications.subscribe("com.myapp")

build.settings

settings = { splashScreen = { enable = false, }, orientation = { default = "portrait", --landscapeRight, landscapeLeft, portrait, portraitUpsideDown supported = { "portrait", "portraitUpsideDown"} }, plugins = { --Facebook ["plugin.facebook.v4a"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true, iphone=true } }, --Ads ["plugin.admob"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.unityads"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, --Notifications ["plugin.notifications.v2"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, --Analytics ["plugin.googleAnalytics"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, ["plugin.firebaseAnalytics"] = { publisherId = "tech.scotth", supportedPlatforms = { iphone=true, android=true } }, --In-app google play ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, }, android = { facebookAppId = "xxxxxxxxxxxxx", usesPermissions = { "android.permission.INTERNET", "android.permission.READ\_EXTERNAL\_STORAGE", "android.permission.WRITE\_EXTERNAL\_STORAGE", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.ACCESS\_WIFI\_STATE", "com.android.vending.BILLING", }, installLocation = "auto", useGoogleServicesJson = true, strings = { ["google\_app\_id"]= "xxxxxxxxxxxxxxxxxxxx" }, applicationChildElements = { -- Array of strings [[\<meta-data android:name="android.max\_aspect" android:value="2.1"/\>]], [[\<meta-data android:name="com.google.android.gms.ads.APPLICATION\_ID" android:value="xxxxxxxxxxxxxxxxxxxx"/\>]], }, intentFilters = { { actions = { "android.intent.action.VIEW" }, categories = { "android.intent.category.DEFAULT", "android.intent.category.BROWSABLE", }, --Previous scheme below data = { scheme = "com.myapp", }, }, { actions = { "android.intent.action.LAUNCHER" }, categories = { "android.intent.category.DEFAULT", }, data = { scheme = "com.myapp", }, }, } }, }

Do you have multiple categories setup in your FCM server side?

Does your app really need to use categories? 

What version of Corona are you using?

Rob