error when build apk....
[enter image description here][1]
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/android/volley/VolleyError;
my gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.morten.gpibwal.desakayuambon"
minSdkVersion 17
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'
}
}
dexOptions {
}
}
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.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}
The solution is
delete "compile 'com.github.bumptech.glide:volley-integration:1.4.0'
com.android.dex.DexException: Multiple dex files define
Lcom/android/volley/VolleyError;
You should delete
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
Then Clean-Rebuild-Run.
add multiDexEnabled true in gradle file also use same version for compile dependencies check below code
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.morten.gpibwal.desakayuambon"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
}
}
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.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:design:25.0.0'
testCompile 'junit:junit:4.12'
}
remove unnecessary empty
dexOptions {
}
Related
When I want to run app on my phone I face this proplem: min sdk 26 > device sdk24
How can I fix that?
build gradle :
android {
compileSdkVersion 26
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.asus.order"
minSdkVersion 26
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
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'
})
//Add Library
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta1'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-database:10.2.1'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'com.android.support:design:26.+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Just set the minSdkVersion to 24 or lower
When we write a code color of word 'Application', it changes to red. Can anyone help me out with this?
Here is my build.gradle app
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.nabeel.ask"
minSdkVersion 16
targetSdkVersion 26
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')
testCompile 'junit:junit:4.12'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support:design:26.+'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.google.android.gms:play-services-auth:8.3.0'
compile 'com.google.android.gms:play-services:8.3.0'
}
Try to clean and rebuild your project
Build>Clean Project/Rebuild project
I can not add a tube to the library I want to cache error, how do I resolve it?
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK builddef.lst
File1: C:\Users\Sims2.gradle\caches\modules-2\files-2.1\com.googlecode.mp4parser\isoparser\1.1.20\44b7ee9785227a29db4048ee36758ffa553b749e\isoparser-1.1.20.jar
File2: C:\Users\Sims2.android\build-cache\ac4f8b61ef7112ca250eee2e786463e96f1ea27c\output\jars\classes.jar
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "*******"
minSdkVersion 19
targetSdkVersion 26
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(dir: 'libs', include: '*.jar')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
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:support-vector-drawable:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'jp.wasabeef:recyclerview-animators:2.2.3'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.hanks:htextview-rainbow:0.1.1'
compile 'com.hanks:htextview-typer:0.1.1'
compile 'com.google.firebase:firebase-ads:11.0.0'
compile 'com.scottyab:aescrypt:0.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.1'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'life.knowledge4:k4l-video-trimmer:1.0'
compile 'com.iceteck.silicompressorr:silicompressor:2.0'
testCompile 'junit:junit:4.12'
}
Just add packagingOptions { exclude 'builddef.lst' } to your gradle file - it should be enough.
Full version:
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "*******"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'builddef.lst'
}
}
this is my project build.gradle file .whenever i run the project in android studio i get the duplicate entry: android/support/v4/util/MapCollections$ArrayIterator.class error
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId "com.aitsolution.bizitapp.bizit"
minSdkVersion 16
targetSdkVersion 23
versionCode 14
versionName "1.13"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
dexOptions {
javaMaxHeapSize "3g"
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
// compile fileTree(include: ['*.jar'], dir: 'libs')
// testCompile 'junit:junit:4.12'
compile files('libs/linkedin-j-android.jar')
compile files('libs/MobileOcrEngine.jar')
compile files('libs/signpost-core-1.2.1.1.jar')
compile files('libs/twitter4j-core-3.0.5.jar')
compile files('libs/ksoap2_2.6.0.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.android.gms:play-services-appindexing:9.0.0'
compile 'com.android.support:cardview-v7:23.3.+'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.edmodo:cropper:1.0.1'
}
I think facebook sdk comes with v4-support library exclude that and try.
compile ('com.facebook.android:facebook-android-sdk:4.6.0') {
exclude module: 'support-v4'
}
Error:Execution failed for task ':jobFlexwithInvoice:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException:duplicateentry:android/support/v4/view/MotionEventCompatEclair.class
i have this problem and my gradle file is,
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.studity.socet_store"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile files('libs/android-support-v4.jar')
compile 'com.android.support:design:22.2.0'
compile files('libs/Parse-1.3.0.jar')
compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
compile files('libs/signpost-jetty6-1.2.1.2.jar')
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:support-v4:22.2.0'
}
what should i do!?
Try this..
compile ('com.android.support:support-v4:22.2.0') {
exclude module: 'support-v4'
}
Instead of
compile 'com.android.support:support-v4:22.2.0'
or exclude module: to other where problem create