duplicate entry: com/google/android/gms/internal/zzfj.class - java

Please help me: Here is Screenshot of Error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzfj.class]1]1
Gradle File: https://drive.google.com/open?id=0BxZ4QxQmqfMHV05oVFc0QmxuTlU
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
multiDexEnabled true
applicationId "aa.bb"
manifestPlaceholders = [onesignal_app_id : "xxx",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
maven {
url "https://mint.splunk.com/gradle/"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':ResideMenu')
compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.onesignal:OneSignal:[3.5.3,4.0.0)'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'org.apmem.tools:layouts:1.10#aar'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.splunk.mint:mint:5.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.github.justzak:dilatingdotsprogressbar:1.0.1'
compile 'com.kaopiz:kprogresshud:1.1.0'
testCompile 'junit:junit:4.12'
}

Related

Couldn't find compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

My build.gradle
apply plugin: 'com.android.application'
android {
signingConfigs {
}
compileSdkVersion 30
buildToolsVersion '30.0.2'
defaultConfig {
applicationId "com.rock08.android.demoapp"
minSdkVersion 22
targetSdkVersion 25
versionCode 2
versionName "0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.android.support:leanback-v17:25.4.0'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support:preference-v7:25.4.0'
compile 'com.android.support:preference-v14:25.4.0'
compile 'com.android.support:preference-leanback-v17:25.4.0'
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:palette-v7:25.4.0'
}
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
The gradle build is getting failed.
ERROR- Could not find method compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
This is expected with Gradle 7.2 since the compile and testCompile configurations have been removed.
You must replace compile with implementation and testCompile with testImplementation
My solution is.
jar file Directory is /WEB-INF/lib/MyJarFile.jar :)
flatDir {
name 'lib'
dirs "$rootProject.projectDir/lib"
}
dependencies {
classpath fileTree(dir: 'lib', include: 'MyJarFile.jar')
}

Error: :app:transformClassesWithJarMergingForDebug

I decided to integrate appodeal into the application, did everything according to the instructions, but the result is still the same:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/widget/DefaultItemAnimator$7.class
I googled this question, but I still could not find a solution.
Here is gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.successdev.bookwindev.bookwin"
vectorDrawables.generatedDensities = ['hdpi', 'xxhdpi']
minSdkVersion 17
targetSdkVersion 25
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':caldroidcustom')
compile 'com.github.johnkil.android-robototextview:robototextview:3.0.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:palette-v7:25.3.1'
compile 'com.aurelhubert:ahbottomnavigation:1.1.8'
compile 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1'
compile 'com.iceteck.silicompressorr:silicompressor:2.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.6'
compile project(':cheetah-mobile-3.4.7')
compile 'com.google.android.gms:play-services:11.0.2'
compile 'com.google.android.gms:play-services-ads:11.0.2'
compile 'com.google.android.gms:play-services-location:11.0.2'
testCompile 'junit:junit:4.12'
}
P.S Sorry for my clumsy English =)
Add this to your app's build.gradle:
configurations.all {
resolutionStrategy {
force 'com.android.support:recyclerview-v7:25.3.1'
}
}

java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzak.class

im working with android,
When the gradle syncs works good, but if I try to compile show me this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzak.class
Follow the another answers in here and here ,
if I delete google play services, result its same.
But the result its same, my gradle:
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.procibernetica.moca"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
compile 'com.google.android.gms:play-services-location:9.6.1'
compile 'com.google.android.gms:play-services-ads:9.6.1'
compile 'com.google.android.gms:play-services-maps:9.6.1'
compile 'com.google.android.gms:play-services-auth:9.6.1'
compile 'com.google.gms:google-services:3.0.0'
compile 'com.google.firebase:firebase-database:9.6.1'
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-auth:9.6.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.github.satyan:sugar:1.5'
compile 'com.android.support:design:25.3.1'
compile 'org.msgpack:msgpack:0.6.11'
compile 'com.theneura:android-sdk:+'
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.2#aar') {
transitive = true
}
compile project(':moca-sdk-android-1.9.6')
testCompile 'junit:junit:4.12'
}
Follow the tutorial:
https://developers.google.com/android/guides/setup
I remove:
compile 'com.google.android.gms:play-services-gcm:9.6.1'
compile 'com.google.android.gms:play-services-location:9.6.1'
compile 'com.google.android.gms:play-services-ads:9.6.1'
compile 'com.google.android.gms:play-services-maps:9.6.1'
compile 'com.google.android.gms:play-services-auth:9.6.1'
And change for:
compile 'com.google.android.gms:play-services:10.2.4'
And works

Android Studio / Gradle errors

My project worked just fine, and out of a sudden when I tried to rebuild it, I got these errors:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :buttonstyle:generateDebugSources, :buttonstyle:mockableAndroidJar, :buttonstyle:prepareDebugUnitTestDependencies, :buttonstyle:generateDebugAndroidTestSources]
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
This is my build gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "ba.application.travel"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11"
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets'] } }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.0.1'
compile project(':buttonstyle')
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:percent:25.0.1'
compile 'com.ashokvarma.android:bottom-navigation-bar:1.3.0'
compile 'com.android.support:support-v4:25.0.1'
compile 'com.android.support:gridlayout-v7:25.0.1'
compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
compile 'com.github.aakira:expandable-layout:1.4.2#aar'
compile 'com.github.grennis:ExpandableRecyclerView:0.9.3'
compile 'com.github.markushi:circlebutton:1.1'
testCompile 'junit:junit:4.12'
}
Try enabling multidex support. Refer the below link to know the steps to enable multidex support in your project.
Enabling multidex support
I solved it by changing an image format from .jpg to .png

Android-Gradle - java.util.zip.ZipException: duplicate entry: android/support/v7/widget/PositionMap.class

i have a problem with a duplicate class in my dependencies.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId 'br.com.etm.checkseries'
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile ('com.android.support:recyclerview-v7:23.1.0'){
exclude module : 'support-v4'
exclude module : 'appcompat-v7'
}
compile('com.mikepenz:materialdrawer:4.3.8#aar') {
transitive = true
exclude module: 'appcompat-v7'
exclude module: 'support-v4'
exclude module: 'recyclerview-v7'
}
compile project(':unity-ads-1.5.6')
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.firebase:firebase-client-android:2.5.2+'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1#aar'
compile 'com.daimajia.androidanimations:library:1.1.3#aar'
compile('com.melnykov:floatingactionbutton:1.3.0') {
exclude module: 'recyclerview-v7'
}
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
compile('com.google.android.gms:play-services-plus:8.4.0') {
exclude module: 'support-v4'
}
compile('com.google.android.gms:play-services-auth:8.4.0') {
exclude module: 'support-v4'
exclude module: 'play-services-base'
}
compile('com.google.android.gms:play-services-ads:8.4.0') {
exclude module: 'support-v4'
}
}
Always and when I run the application in an emulator API 16, this error occurs:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/widget/PositionMap.class
But when I run in an emulator API 20, the project run smoothly.

Categories

Resources