Android Firebase Messaging Change for Android 12+ to prevent app crash when calling voltmx.push.register() in Iris v9.5

This post should be turned into a KB article.

This article is relevant to Iris v9.5, the issue does not occur in Iris v9.2.

Environment:
Windows 10
Volt Iris v9.5.4
Samsung Galaxy Z Flip 4
Android 13

This is relevant to enabling an Android application to receive push notifications. After configuring the Firebase environment and the appropriate settings in Iris v9.5, the following error occurs when calling the voltmx.push.register() API:

--------- beginning of crash
01-04 21:36:30.629 17571 22996 E AndroidRuntime: FATAL EXCEPTION: Thread-13
01-04 21:36:30.629 17571 22996 E AndroidRuntime: Process: [your Android bundle name here], PID: 17571
01-04 21:36:30.629 17571 22996 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId;
01-04 21:36:30.629 17571 22996 E AndroidRuntime: at com.konylabs.fcm.b.run(UnknownSource:20)
01-04 21:36:30.629 17571 22996 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012)
01-04 21:36:30.629 17571 22996 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceId" on path: DexPathList[[zip file "/data/app/~~Tk3OCcf09wcn488I8C6Wdg==/cn.pingchensaga.fcmtest1-NBhZ5A-Ol7C7iQ5cWmbmSA==/base.apk"],nativeLibraryDirectories=[/data/app/~~Tk3OCcf09wcn488I8C6Wdg==/cn.pingchensaga.fcmtest1-NBhZ5A-Ol7C7iQ5cWmbmSA==/lib/arm64, /data/app/~~Tk3OCcf09wcn488I8C6Wdg==/cn.pingchensaga.fcmtest1-NBhZ5A-Ol7C7iQ5cWmbmSA==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
01-04 21:36:30.629 17571 22996 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
01-04 21:36:30.629 17571 22996 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
01-04 21:36:30.629 17571 22996 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
01-04 21:36:30.629 17571 22996 E AndroidRuntime: ... 2 more

To resolve this, the following dependency needs to be added to the build.gradle entries to Suffix in the Native -> Android Mobile/Tablet -> Gradle Entries section:

dependencies {
implementation 'com.google.firebase:firebase-iid:21.1.0'
}

If there are already entries for dependencies, only the single implementation line needs to be added.

Thanks Gunndarr! We've created an article:

https://support.hcltechsw.com/csm?id=kb_article&sysparm_article=KB0102402