Reputation: 3057
I am getting below error while running "sudo ionic cordova emulate android" in ionic 3 project.
- What went wrong: Execution failed for task ':transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzcar.class
I got the solution to keep all google-play service at same version in build.gradle
buildscript { repositories { jcenter() maven { url "https://maven.google.com" } }
// Switch the Android Gradle plugin version requirement depending on the
// installed version of Gradle. This dependency is documented at
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
compile "com.google.android.gms:play-services-auth:11.8.0" compile "com.google.android.gms:play-services-identity:11.8.0" compile "com.google.android.gms:play-services-location:11+" compile "com.android.support:support-v4:23+" compile "com.google.android.gms:play-services-base:11.0.4" compile "com.google.android.gms:play-services-ads:11.0.4"
Each time i am making change in platforms/android/build.gradle from 11.8.0 to 11.0.4 and building my project with "sudo ionic cordova emulate android". All the change in build.gradle are reverted back. Is there is any way to sync this in ionic project. I did not find any command to sync it. I am using [email protected]
ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
@ionic/app-scripts : 3.1.6
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.10.0
npm : 5.8.0
OS : macOS High Sierra
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Upvotes: 3
Views: 1930
Reputation: 3057
Need to update ".//platforms/android/project.properties" file, while building it will update build.gradle file
Upvotes: 0