in Android Studio Error “duplicate entry: com/google/android/gms/analytics/internal/Command$1.class” - android-studio

Here is my gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
compileOptions.encoding = 'ISO-8859-1'
defaultConfig {
multiDexEnabled true
applicationId "com.mujihamzale.Ayat-AyatMerdu"
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'joda-time:joda-time:2.2'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
compile files('libs/libGoogleAnalyticsServices.jar')
}
But when running the application on android studio 2.1.3, I get the following error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/analytics/internal/Command$1.class
I have been for days to look for a solution, Please Could you tell me how to solve this problem?

Related

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.>Compilation failed; see the compiler error output for details

apply plugin:'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
multiDexEnabled true
applicationId "com.tubbs.citychurchob"
minSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
android.support.test.runner.AndroidJUnitRunner
buildTypes{
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir:'libs', include:['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.firebaseui:firebase-ui:0.4.2'
compile 'com.google.firebase:firebase-database:10.0.1'
}
How to fix this error
Pls ans me.....
I'm using Android studio 2.3.1

Error:Execution failed for task :app:transformClassesWithJarMergingForRelease

Hello i have a problem and i need some help
i want to integrate facebook Sdk in my project to facebook ads to get installs and i got some errors
This is the error :
Error:Execution failed for task'
:app:transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry: android/support/v4/media/TransportPerformer.class
And this is my build.gradle code :
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.example.example"
minSdkVersion 15
targetSdkVersion 24
multiDexEnabled true
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
sourceSets.main {
jni.srcDirs = []// <-- disable automatic ndk-build call}
}
`repositories {
mavenCentral()
}
dependencies {
compile('com.google.android.gms:play-services:+'){exclude module: 'support-v4'}
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/support-v4-19.0.1.jar')
compile 'com.facebook.android:facebook-android-sdk:[4,5)'}`
Have you tried to run './gradlew clean' in your project?

Error: com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/pubnub/api/AbstractLogger.class

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/pubnub/api/AbstractLogger.class
i am facing this error while building the gradle can anyone help me out.????
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "io.atlanticlab.pubnubmaptracker"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.pubnub:pubnub-android-debug:3.7.10'
compile 'com.pubnub:pubnub-android:3.7.10'
}
repositories {
mavenCentral()
}

gradle: Execution failed for task ':myApp:processDebugManifest'

I have am really stumped...
I have an Android Studio (version 1.4) project consisting of two modules - androidLVL and myApp. When I attempt to build the project (Build -> Rebuild Project) I get these messages:
:myApp:processDebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':myApp:processDebugManifest'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Previous answers to this question indicate the error can be caused by incompatible sdk version numbers in the gradle build files - but I can't figure out what the correct versions should be. I edited the build files, but to no avail. Can someone please help? Here are the two gradle build files:
androidLVL:
apply plugin: 'com.android.library'
android {
// compileSdkVersion 22
compileSdkVersion 'Google Inc.:Google APIs:8'
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 10
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
}
dependencies {
compile 'com.google.android.gms:play-services:4.2.42'
compile 'com.android.support:appcompat-v7:22.0.+'
}
myApp:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:8'
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.tomoreilly.myApp"
minSdkVersion 10
targetSdkVersion 22
compileSdkVersion 22
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard-android.txt', 'proguard-project.txt'
}
}
}
dependencies {
compile project(':androidLVL')
compile files('libs/acra-4.2.3.jar')
compile files('libs/htmllexer.jar')
// compile "com.android.support:appcompat-v7:21.0.3"
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
}
(Re the error message suggestion to 'run with --stacktrace option' etc. - I do not know how to invoke these options from within Android Studio).

VerifyError Exception on Android Studio

I'm running my app on Android Studio 1.3.2, and getting an exception that I can't get through. I've been searching on google for hours and didn't find the solution.
java.lang.VerifyError: org/apache/http/conn/ssl/DefaultHostnameVerifier
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:944)
at com.romi.expensemanager.OCRServiceAPI.sendImage(OCRServiceAPI.java:62)
at com.romi.expensemanager.OCRServiceAPI.convertToText(OCRServiceAPI.java:44)
at com.romi.expensemanager.Main$1.run(Main.java:68)
at java.lang.Thread.run(Thread.java:856)
I add external jars:
httpclient-4.5.jar, httpcore-4.4.1.jar, httpmime-4.5.jar.
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.romi.expensemanager"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
compile files('libs/achartengine-1.1.0.jar')
compile files('libs/picasso-2.5.2.jar')
compile project(':httpclient-4.5')
compile project(':httpcore-4.4.1')
compile project(':httpmime-4.5')
}
Any help will be appreciated. Thanks.

Resources