Open kobrecht12 opened 3 years ago
Which version of cordova-android
are you using?
If you use a lower version than 9.0
then you could try adding the following plugin to your project:
cordova plugin add cordova-plugin-androidx-adapter
Explanations:
If your Cordova project contains plugins/libraries which reference both the Android Support Library and AndroidX, your Android build will fail because the two cannot live side-by-side in an Android build.
This plugin provides a shim to migrate references to the legacy Android Support Library to the new AndroidX mappings in a Cordova Android platform project.
This enables a Cordova project for which AndroidX has been enabled (e.g. using cordova-plugin-androidx) to successfully build even if it contains plugins which reference the legacy Support Library.
Source: https://github.com/dpa99c/cordova-plugin-androidx-adapter#readme
Which version of
cordova-android
are you using?If you use a lower version than
9.0
then you could try adding the following plugin to your project:cordova plugin add cordova-plugin-androidx-adapter
My cordova android is version 10.0.0
Sorry, I mixed up cordova-plugin-androidx
and cordova-plugin-androidx-adapter
when I asked for your current cordova-android
version.
You should definitively try to install cordova-plugin-androidx-adapter
because the Google Maps plugin is still using the (old) Android Support Library, which is not compatible with AndroidX.
Sorry, I mixed up
cordova-plugin-androidx
andcordova-plugin-androidx-adapter
when I asked for your currentcordova-android
version.You should definitively try to install
cordova-plugin-androidx-adapter
because the Google Maps plugin is still using the (old) Android Support Library, which is not compatible with AndroidX.
Just did and it built successfully, can't thank you enough!!
I have the same Issue. I also was able to fix it using cordova-plugin-androidx-adapter
.
But there is another plugin called cordova-androidx-build which was built by @wf9a5m75 who also built cordova-plugin-googlemaps
. The description of the plugin says the following:
However cordova-plugin-androidx-adapter works on only your PC, because it uses Cordova Hook Script mechanism. Because of this, cordova-plugin-androidx-adapter does NOT work on cloud build services, such as PhoneGap Build.
I'm using Ionic Appflow, so I can't use cordova-plugin-androidx-adapter
. Thats the reason why I'm using the multiple_maps
Branch, which comes with cordova-androidx-build
and should work with cordova-plugin-googlemaps
. But sadly I'm getting an error I've never seen before:
> Task :app:checkDebugDuplicateClasses FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class com.google.android.gms.common.api.internal.zza found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.api.internal.zzb found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.api.internal.zzc found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.api.internal.zzd found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.api.zza found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.api.zzb found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.internal.zzb found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.internal.zzc found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.internal.zzd found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.internal.zzf found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.internal.zzg found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.internal.zzk found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.internal.zzl found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.internal.zzm found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.internal.zzn found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Duplicate class com.google.android.gms.common.zza found in modules jetified-play-services-base-15.0.1-runtime.jar (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.3.0-runtime.jar (com.google.android.gms:play-services-basement:17.3.0)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
It seems to work if I remove cordova-plugin-purchases
and cordova-admob-plus
. I really don't know whats going on here.
I had the same error and I was able to fix it by switching to the multiple_maps
branch.
I am using the Ionic framework on a MacBook Pro running Big Sur, and I am trying to run "cordova build android" but I am getting a long list of 25 errors and don't even know where to start. The build runs fine when building for iOS but not Android.
I had a host of other problems stemming from duplicate declarations of uses-feature statements in the AndroidManifest.xml file but was able to resolve those over a few days and that brings me until now.
this may be the wrong place to put this question, but the first couple errors are all stemming from plugin/google/maps so it may be...
The errors looks as follows:
Here are the following cordova plugins that I have installed:
I am not really sure what is causing all of these problems, so any help would be greatly appreciated! Thanks!