Plugin not installed but build log says it is, and Android 12 splashscreen issues

Hi, I am using <plugin name="cordova-plugin-firebase-messaging" /> which is fine on iOS builds but for some reason it doesn’t seem to be installing on android builds.

Having looked at the build log it looks like it says it was installed but in the app I get undefined when I try to call the plugin.

Also its not listed in the plugin files when I use chrome://inspect.

Any ideas?

1 Like

Are there any other messages in chrome://inpect’s console?

What shows up when you type this in the remote console?

cordova.plugins

Hi, when I type cordova.plugins the firebase plugin is not listed.

No other errors or warnings in the console other than cordova.plugins.firebase is not recognised , or something along those lines.

No idea - we’re not experts on third party plugins. Are your other plugins working OK?

Have you looked at the open issues in the cordova.plugins.firebase repo?

I have tried to build again, after checking the log in more depth i found this note

Installing "cordova-plugin-firebase-messaging" for android
Plugin doesnt support this project's cordova-android version. cordova-android: 9.1.0, failed version requirement: >=11.0.0
Skipping 'cordova-plugin-firebase-messaging' for android

All other plugins are working, no open related issues for this plugin.

That explains it.

The proper solution is to update your project. Have a look at this doc.

Even though I have set <engine name="android" spec="11.0.0" /> Make Native App with VoltBuilder is building to cordova-android: 10.1.2 ?

Hang on - we’re working enabling that now.

Ok great.

Thank you. I’ll come back to it later on or tomorrow.

8.5.7.3 is out. It has new option in Project Properties, in the VoltBuilder and Capacitor section.

If Android 12 is set to yes, your build will be for that. You still have to make the other changes in this doc.

Thank you. Working fine.

Thank you, I’ll take a look.

Android 12 SOLVED:
When you add <engine name="android" spec="11.0.0" /> to the config file DO NOT put it inside the <platform name="android" > tags, otherwise it gets ignored.

minSdkVersion : must be set to at least 21.
android-targetSdkVersion : 31
cordova-plugin-x-socialsharing: Is currently not compatible with Android 12.

This version works with Android 12 <plugin name="cordova-plugin-x-socialsharing-android12" />

Yes - that would account for it.

Just one more thing, since using Android 12 a cordova splashscreen is used rather than mine.

That means it was unable to find or use your icon. Have a look at the log - there should be more info there.

This is from the build log:

The "<splash>" tags were detected and are no longer supported. Please migrate to the “preference” tag “AndroidWindowSplashScreenAnimatedIcon”

The “AndroidWindowSplashScreenAnimatedIcon” is undefined. Cordova’s default will be used.

The “AndroidWindowSplashScreenBrandingImage” is undefined. Cordova’s default will be used.

Wrote out Android application SplashScreen Icon Color to /platforms/android/app/src/main/res/values/colors.xml

Wrote out Android application themes to /platforms/android/app/src/main/res/values/themes.xml

delete platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher.xml (no source)
delete platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_background.png (no source)
delete platforms/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png (no source)

This may help : https://ionic.zendesk.com/hc/en-us/articles/7891143965975-Migrating-to-Cordova-Android-11

Thanks - that link will help people. We’re doing more testing here to see if we can make this easier.

Ok great, thank you.

I haven’t followed the instructions in the link yet as I believe VoltBuilder currently handles the splashscreens?

We’re still checking out how VoltBuilder handles splash screens for Android 12.