When installing this plugin in combination with AdMob Free 'ionic cordova build android' the process throws the following error.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzau.class
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 9.655 secs
Error: /Users/Daniel/Code/baseball/baseball_app/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzau.class
This error is clearly introduced by the combination of the two plugins. I checked this in a fresh ionic project where I only installed these two plugins and got the same error.
I did find this issue which seems to have a similar problem (https://github.com/arnesson/cordova-plugin-firebase/issues/387). Removing the following two lines from plugin.xml in this repo did not solve the error though.
<framework src="com.google.gms:google-services:+" />
<framework src="com.google.android.gms:play-services-tagmanager:+" />
Receiving same issue as above.
+1
downgrading version of AdMob plugin resolved my issue
remove old admob plugin then
ionic cordova plugin add [email protected]
Try installing https://github.com/dpa99c/cordova-android-support-gradle-release or https://github.com/dpa99c/cordova-android-play-services-gradle-release to fix the gradle build
use https://www.npmjs.com/package/cordova-plugin-firebase-extended-notification plugin with admob free it works just
manually edit
cordova.system.library.1=com.google.android.gms:play-services-base:10.+
cordova.system.library.2=com.google.android.gms:play-services-ads:10.+
cordova.system.library.3=com.google.firebase:firebase-core:10.+
cordova.system.library.4=com.google.firebase:firebase-messaging:10.+
cordova.gradle.include.1=cordova-plugin-fcm-with-dependecy-updated/epapers-FCMPlugin.gradle
cordova.gradle.include.2=cordova-plugin-firebase-extended-notification/epapers-FirebaseExtendedNotification.gradle
in project.properties file
Most helpful comment
downgrading version of AdMob plugin resolved my issue
remove old admob plugin then
ionic cordova plugin add [email protected]