I'm a student programmer and I'm continuing an Android project that has been previously started by other students before me. My problem is that I'm getting an error when I try to execute the Android app inside Android Studio. You can see the error message below. The compilation must have worked for the other students since I have an apk file. What's wrong with zipalign?
:app:zipalignDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:zipalignDebug'.
> Process 'command 'X:\Sdk Android Studio\build-tools\21.1.2\zipalign.exe''
finished with non-zero exit value -1073741502
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "csf.dfc.friendtracker"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
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:21.0.3'
compile files('libs/guava-18.0.jar')
compile files('libs/Pubnub-Android-3.7.2.jar')
compile files('libs/mysql-connector-java-5.1.34-bin.jar')
}
EDIT:
I haven't found the cause of the error but I added all the project objects in a new one and the error disappeared.
Remove the apk file in the Deploy directory and the export worked fine then.
I realized this happen when you have the directory "..\app\build\outputs\apk\" open in your Windows Explorer. You just need to close it and rebuild the project.
This happened to me too, when I tried to generate the apk in the following path:
C:\users\desktop
Change your signed generated apk destination path used to generate to the following:
<your project path>\app\build\outputs\apk
Example:
E:\androidStudio\CountDownTimer\app\build\outputs\apk
Related
everything was working fine i dont know what happend
no its not an XML file..not its not clean rebuild ..no its not sync ...sos what could it be...
this is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "seniorreminder.androidstudioprojects.com.seniorreminder"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
}
this is the error Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\User-Pc\AppData\Local\Android\Sdk\build-tools\25.0.3\aapt.exe'' finished with non-zero exit value -1073741818
please someone help
Your virus scanner (Avast for me) probably detected this threat as a false positive for malware. This happened and it alerted me. You must take it out of quarantine or allow it. If you can't, I recommend re-downloading build-tools version.
From: https://developer.android.com/studio/intro/update.html
"Open the SDK Manager from Android Studio, click Tools > Android > SDK Manager or click SDK Manager in the toolbar. If you're not using Android Studio, you can download tools using the sdkmanager command-line tool.
When an update is available for a package you already have, a dash appears in the check box next to the package.
To update an item or install a new one, click the check box so it shows a checkmark."
My question is, I was try to change the package name of my android project, when I build my project it's give me error, And then I pressed ctrl+z button to rewrite my package name before and try to built it again it's not build my project.
my error is
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\DELL\Documents\adt-bundle-windows-x86-20140702\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1
First you see the screen shot
now you see my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "app.tabsample"
minSdkVersion 15
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:23.1.0'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.android.gms:play-services-ads:8.3.0'
}
I have a latest build version
classpath 'com.android.tools.build:gradle:1.3.0'
and also I tried to clean and rebuild the project and also I tried to restart the Android studio but the error not goes. It's my complete whole project.
As written in the first error, you have a space which is an invalid character in the category tag it should be <category android:name=android.intent.category.default/>.
I am trying to build my project with AIDL example. But I keep getting this error:
:app:compileDebugAidl
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
Error:Execution failed for task ':app:compileDebugAidl'.
> com.android.ide.common.process.ProcessException:org.gradle.process.
internal.ExecException:
Process 'command 'C:\Users\xuefu\AppData\Local\Android\sdk\build-tools\23.0.1\aidl.exe''
finished with non-zero exit value 3
Information:BUILD FAILED
below is my build file and I am using Android Studio 1.3.2, Gradle 1.3.0 under the windows 8.1 x64 platform:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "org.crazyit.service"
minSdkVersion 10
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
}
Please check your aidl files, make sure all the files include the package name. e.g.
package com.zebra.gogogo;
parcelable GoInfo;
Everybody, im trying to generate a signed APK file , with android studio, Firts of all, I changed the "Build variant" from debug to release, then on grade.app minifyEnabled i put true, finally I created my Key and my password, and everything is alright until here, but on my last click, Android studio trys to generate the file but this message comes out
Warning: com.google.android.gms.auth.GoogleAuthUtil: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning: there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
:app:proguardRelease FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:proguardRelease'.
java.io.IOException: Please correct the above warnings first.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
im too new with this software , so please be patient with me, i dont know which libraries should i Update.
My compileSdkVersion is 23, and my targed sdk version is 23.
Thanks you all of you.
here is my build.grade file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.manuelrios.aplicacion_inmobiliaria"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services:4.2.42'
}
Add the below code in your app gradle
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
.
.
.
lintOptions {
checkReleaseBuilds false
}
}
I am getting an ':app:packageAllDebugClassesForMultiDex' Error when I try to build an application using the YouTubeData API. I have researched several other threads that cover this error and the conclusion that I have come to is that I have libraries in my build file that are creating a duplicated reference to build files. I know that the file triggering the error is:
'com/google/api/client/googleapis/json/GoogleJsonErrorContainer.class'
but how do I exclude the reference from the build file with out removing the entire library?
This is my build file
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "co.hannalupi.fitnessblenderapp"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.apis:google-api-services-youtube:v3-rev136-1.20.0'
}
This is the error I get:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/api/client/googleapis/json/GoogleJsonErrorContainer.class
I am new to Android, any direction you can point me in would be greatly appreciated. Thanks in advance.
An update for folks having a similar error - As a last resort I deleted the project file that I was working in from my desktop and cloned a fresh copy from GitHub. Importing and running the fresh copy gave me no errors!!