While building apk for my project, I'm getting the following error:
Code:
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/simplejavamail/email/AttachmentResource.class
Here's my gradle file:
Code:
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 24
buildToolsVersion '24.0.1'
defaultConfig {
applicationId "com.parassidhu.cdlumaths"
minSdkVersion 16
targetSdkVersion 24
versionCode 2
versionName "1.1"
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "8g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:8.0.1'
compile 'com.github.paolorotolo:appintro:3.4.0'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.hotchemi:android-rate:1.0.1'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'org.simplejavamail:simple-java-mail:4.1.1'
compile files('libs/simple-java-mail-4.1.1.jar')
}
apply plugin: 'com.google.gms.google-services'
I
I have no idea what's wrong. I can test the app fine but when I Rebuild project/build apk/generate signed apk, I get this error. Sometimes the duplicate entry points to different class than AttachmentResource.class.
Related
I'm trying to reduce google play services' impact on APK size. I get the following error when i try to synchronize the gradle proyect. I would be very thankful if somebody can help me with this problem.
Error8, 0) Gradle DSL method not found: 'compile()'
Possible causes:
- The project 'MorphingTunnelFreeLauncher' may be using a version of Gradle that does not contain the method. Gradle settings
- The build file may be missing a Gradle plugin.
The changes in the gradle code looks like this:
- build.gradle in googleplayservices_lib
apply plugin: 'com.android.library'
android {
compileSdkVersion 9
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
minifyEnabled true //changed
shrinkResources true //changed
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile files('libs/google-play-services.jar')
}
- build.gradle in the app itself:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
compile 'com.google.android.gmslay-services-ads:6.5.+'//changed
}
}
allprojects {
repositories {
jcenter()
}
}
I am trying to import some libraries, in Android Studio. I had the following error message: Error:The SDK Build Tools revision (17.0.0) is too low for project ':actionbarsherlock'. Minimum required is 19.1.0
So i installed Android SDK Build tools rev 19.1.0. I modified build.gradle file (app) looking like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
applicationId "com.example.xx.xx"
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.2"
}
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:19.1.0'
compile 'com.android.support:support-v4:19.1.0'
compile project(':actionbarsherlock')
compile project(':actionbarsherlock-fest')
compile project(':actionbarsherlock-i18n')
}
Also in Run/Debug Configurations, under App Engine DevAppServer, i set in App Engine SDK field the path for the new SDK, looks like that: C:\Users\cami\AppData\Local\Android\sdk\build-tools\19.1.0
So when i am trying to rebuild, i get exactly the same error message as before. Additionally, i had installed Android SDK Build tools rev 22.0.1, and i get warning saying update targetSdkVersion to 22.
Could please someone help me with this?
PS: Sorry for the very long post, and maybe for the many unnecessary details, but i am new in Android Dev.
Thank you
cinsa said:
I am trying to import some libraries, in Android Studio. I had the following error message: Error:The SDK Build Tools revision (17.0.0) is too low for project ':actionbarsherlock'. Minimum required is 19.1.0
So i installed Android SDK Build tools rev 19.1.0. I modified build.gradle file (app) looking like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
applicationId "com.example.xx.xx"
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.2"
}
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:19.1.0'
compile 'com.android.support:support-v4:19.1.0'
compile project(':actionbarsherlock')
compile project(':actionbarsherlock-fest')
compile project(':actionbarsherlock-i18n')
}
Also in Run/Debug Configurations, under App Engine DevAppServer, i set in App Engine SDK field the path for the new SDK, looks like that: C:\Users\cami\AppData\Local\Android\sdk\build-tools\19.1.0
So when i am trying to rebuild, i get exactly the same error message as before. Additionally, i had installed Android SDK Build tools rev 22.0.1, and i get warning saying update targetSdkVersion to 22.
Could please someone help me with this?
PS: Sorry for the very long post, and maybe for the many unnecessary details, but i am new in Android Dev.
Thank you
Click to expand...
Click to collapse
Try change "buildToolsVersion '19.1.0'" to "buildToolsVersion '22.0.0'" Pay attention that you should have installed build tools 22 in your SDK Manager.
It should help.
I clean and rebuild my project with success but when i run it, it gives me an error. I tried many solution but i couldn't solve with them.
This is my error :
Code:
Error:duplicate files during packaging of APK /Users/ege/AndroidStudioProjects/projectandroid/projectAndroid/build/outputs/apk/projectAndroid-debug-unaligned.apk
Path in archive: AndroidManifest.xml
Origin 1: /Users/ege/AndroidStudioProjects/projectandroid/projectAndroid/build/intermediates/resources/resources-debug.ap_
Origin 2: /Users/ege/AndroidStudioProjects/projectandroid/projectAndroid/build/intermediates/javaResources/debug/AndroidManifest.xml
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'AndroidManifest.xml'
}
}
Error:Execution failed for task ':projectAndroid:packageDebug'.
Duplicate files copied in APK AndroidManifest.xml
File 1: /Users/ege/AndroidStudioProjects/projectandroid/projectAndroid/build/intermediates/resources/resources-debug.ap_
File 2: /Users/ege/AndroidStudioProjects/projectandroid/projectAndroid/build/intermediates/javaResources/debug/AndroidManifest.xml
This is my build gradle:
Code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '23.0.0 rc2'
defaultConfig {
applicationId "com.project.android"
minSdkVersion 14
targetSdkVersion 19
multiDexEnabled true
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "2g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
packagingOptions {
exclude 'AndroidManifest.xml'
}
}
}
dependencies {
compile project(':slidingMenuLibrary')
compile project(':pullToRefreshLibrary')
compile project(':placeActivity')
compile project(':jMC')
compile project(':salesforceSDK')
compile project(':library')
compile files('../libMaster/android-integration-2.3-SNAPSHOT.jar')
compile files('../libMaster/com.radaee.pdfex_view.jar')
compile files('../libMaster/core-2.3-SNAPSHOT.jar')
compile files('../libMaster/ksoap2-android-assembly-3.2.0-jar-with-dependencies.jar')
compile files('../libMaster/libGoogleAnalyticsServices-v3.01.jar')
compile files('../libMaster/urbanairship-lib-3.0.0.jar')
compile 'com.google.api.client:google-api-client-repackaged-com-google-common-base:1.2.3-alpha'
compile 'com.google.code.gson:gson:2.3.1'
compile ('com.android.support:support-v4:22.2.0'){
exclude group: 'multidex'
}
compile files('../libMaster/commons-lang3-3.1.jar')
compile files('../libMaster/aws-android-sdk-1.4.4-s3.jar')
compile files('../libMaster/aws-android-sdk-1.4.4-core.jar')
compile files('../libMaster/universal-image-loader-1.8.5-with-sources.jar')
}
I also tried this solution, but didn't work :
Code:
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
"Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined?"
Recently (3 days ago) I started learning Android Studio. I bought an Eclipse game project to play with, but I am getting errors. And when I fix that error, I get a new error. The current error is as following:
Build command failed. Error while executing process C:\Users\user\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\APPS\app\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\APPS\app\src\main\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=0 APP_PLATFORM=android-15 NDK_OUT=C:/APPS/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\APPS\app\build\intermediates\ndkBuild\release\lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n} Android NDK: C:\APPS\app\src\main\jni\Android.mk: Cannot find module with tag 'box2D' in import path Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ? Android NDK: The following directories were searched: Android NDK:
process_begin: CreateProcess(NULL, "", ...) failed.
Click to expand...
Click to collapse
I have googled and I saw a few other people had asked this question on this forum, but I didn't understand how to fix it (again, I'm a complete beginner)
Here's my build.gradle (Module: app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.getemplate.catadventure"
minSdkVersion 15
targetSdkVersion 26
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
}
dependencies {
compile 'com.google.android.gmslay-services:+'
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')
}
Click to expand...
Click to collapse
And here is my Android.mk file:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := player_shared
LOCAL_MODULE_FILENAME := libplayer
LOCAL_SRC_FILES := main.cpp
LOCAL_WHOLE_STATIC_LIBRARIES := core_static cocos2dx_static box2d_static
GOOGLE_PLAY_STORE := true
include $(BUILD_SHARED_LIBRARY)
$(call import-module, box2D) $(call import-module, core) $(call import-module, cocos2dx) $(call import-module,android-ndk-profiler/jni)
Click to expand...
Click to collapse
Thanks in advance! :good:
Hi everyone
I was trying to build my app on android studio but suddunly ive got this erreo: AAPT2 process unexpectedly exit. Error output"
and after that i cant build my app.so i search about it and did every soultion on Internet but non of them work for me.
im trying to fix this issue for 2 days.so please help me to fix it
thanks.
THIS IS MY GRADLE FILE:
Code:
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.weather5"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.android.support:support-annotations:28.0.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
delete you gradle file in studio dir then restart you studio