buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.jakewharton.hugo:hugo-plugin:1.1.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'hugo'
configurations {
preprocess
}
android {
compileSdkVersion 21
buildToolsVersion "21.0.2"
defaultConfig {
applicationId "uz.taxiapp.android"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
// make sure that lint errors don't fail the build as lint does not always work properly with the android gradle plugin
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:support-v4:$depAndroidSupportVersion"
compile "com.android.support:support-v13:20.0.+"
compile "com.android.support:appcompat-v7:$depAndroidSupportVersion"
compile 'com.google.android.gms:play-services:6+'
compile "com.android.support:recyclerview-v7:$depAndroidSupportVersion"
compile "com.j256.ormlite:ormlite-android:$depOrmLiteVersion"
compile "com.google.code.gson:gson:$depGsonVersion"
preprocess "com.squareup.dagger:dagger-compiler:$depDaggerVersion"
compile "com.squareup.dagger:dagger:$depDaggerVersion"
compile "com.squareup.picasso:picasso:$depPicassoVersion"
compile "com.squareup:otto:$depOttoVersion"
compile "com.squareup.retrofit:retrofit:$depRetrofitVersion"
preprocess "com.jakewharton:butterknife:$depButterKnifeVersion"
compile "com.jakewharton:butterknife:$depButterKnifeVersion"
compile "com.jakewharton.timber:timber:$depTimberVersion"
compile project (':JobQueue')
compile "com.jpardogo.googleprogressbar:library:$depGoogleProgressbarVersion"
compile 'com.iangclifton.android:floatlabel:1.0.1'}
android.applicationVariants.all { variant ->
//Where to place the generated code
variant.ext.set("gen_${variant.dirName}", file("${project.buildDir}/source/gen/${variant.dirName}"))
//Do the actual preprocessor things
variant.javaCompile.doFirst {
File out = variant.ext.get("gen_${variant.dirName}")
out.mkdirs()
variant.javaCompile.options.compilerArgs += [
'-processorpath', configurations.preprocess.getAsPath(),
'-s', out
]
}
}
This gradle code returns error
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Алексей\AppData\Local\Android\sdk\build-tools\21.0.2\aapt.exe'' finished with non-zero exit value 1
If you have installed Java 8, uninstall it completely install Java 7 by updating the environment variables.
Related
My apps worked fine until some day I receive this message on Gradle Build.
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
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "info.blacktrail.quinielacatamarca"
minSdkVersion 15
targetSdkVersion 23
versionCode 13
versionName "3.47"
multiDexEnabled true
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services:9.0.2'
compile files('libs/jsoup-1.8.1.jar')
compile files('libs/htmlcleaner-2.16.jar')
}
apply plugin: 'com.google.gms.google-services'
I updated my Android Studio, I cleaned the project I rebuilded the project and the error still.
Any idea on how to resolve this?
i tried to run my app in avd but when i select to run the gradle turn an exception :
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Library dex files are not supported in multi-dex mode
:app:transformClassesWithDexForDebug FAILED
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' finished with non-zero exit value 2
my app is synced successfully when i sync it but on running time!
this is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "ir.esfandune.material"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
incremental true
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.github.rey5137:material:1.2.1.6-SNAPSHOT'
compile project(':material-dialogs')
compile files('lib/glide-3.6.1- 3f8a822297969bbac00507aeca83271794f037ca.jar')
//compile files('lib/de.hdodenhof/circleimageview/1.3.0/jars/classes.jar')
}
and this is my other module gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "ir.esfandune.material"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
incremental true
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.github.rey5137:material:1.2.1.6-SNAPSHOT'
compile project(':material-dialogs')
compile files('lib/glide-3.6.1-3f8a822297969bbac00507aeca83271794f037ca.jar')
}
i searched for fix this error on stackoverflow and google but didnt find any useful answer!
is that any one that can help me plz?
check all your libraries you use, including dependencies of the libraries and make sure there are no conflicting versions.
open terminal from Android Stodio and type in: "./gradlew clean"
build again
Suddenly I could not build my projects with Android Studio by this following error. I have attached build.gradle file and SDK installation images, I have tried several hours but I could not get solved. Please help me to solve this problem.
Error:
Error:Execution failed for task ':qApp:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/node/Android/Sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1
build.gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.+'
}
}
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.qapp"
minSdkVersion 14
targetSdkVersion 21
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':facebookSDK')
compile project(':payPalDemo1')
compile project(':uberLibrary')
compile project(':bSLibrary')
compile project(':pullToRefresh')
compile project(':androidmapsutils')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:multidex:1.0.0'
compile files('libs/android-async-http-1.4.6.jar')
compile files('libs/cardio.jar')
compile files('libs/UserFormValidation.jar')
}
SDK list
Try to add this inside you gradle file:
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 23
.....
dexOptions {
javaMaxHeapSize "4g"
}
}
Try to add this lines in your dependencies:
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
And in the defaultConfig, use the same targetSdkVersion of the compileSdkVersion
new to Android Studio.
I've just created a new blank app and added a new Google Cloud Module.
After adding the module I get the error:
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2
I have read the multiple answers here on StackOverflow, all suggesting an error with gradle dependencies, however I cannot see one. Here are my two gradle files:
build.gradle (Module: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.bristow.conor.intellipa"
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.android.gms:play-services:8.1.0'
compile project(path: ':backend', configuration: 'android-endpoints')
}
build.gradle (Module: backend)
// If you would like more information on the gradle-appengine-plugin please refer to the github page
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.18'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.18'
compile 'com.google.appengine:appengine-endpoints:1.9.18'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.18'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:4.0b3'
compile 'com.ganyo:gcm-server:1.0.2'
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}
I do not see any duplicates nor am I using a '+' with the version numbers that seem to solve other peoples problems. I haven't added/modified or tinkered with the project yet bar adding the module. Prior to adding the module, it compiles correctly.
Add this line in gradle file
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
use compile 'com.google.android.gms:play-services-gcm:8.3.0'
instead of 'com.google.android.gms:play-services:8.1.0'
My error:
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_20\bin\java.exe'' finished with non-zero exit value 2
I have zero clue where this is coming from. I'm trying to integrate Stripe so possibly it could be a gradle issue.
Stripe is a external library integrated.
App build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.weaverprojects.stripe2"
minSdkVersion 21
targetSdkVersion 23
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 project(':stripe')
//compile 'com.android.support:support-v4:18.0.+'
compile 'com.google.code.gson:gson:2.3'
compile 'org.parceler:parceler:0.2.13'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup:otto:1.3.6'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
}
Stripe library build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 21
targetSdkVersion 23
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.stripe:stripe-java:1.15.1'
//compile 'com.google.code.gson:gson:2.2.4'
}
Top level build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Settings.gradle:
include ':app', ':stripe'
I had your problem right now, I solved it checking the dependencies ( I had one library with different version of the same dependence) and rebuild the project.
Check also this answer.
So try:
1- Check dependecies and resolve the different versions or conflicts of the same library/dependence
2- Resync Gradle
3- Rebuild the project (this was essential for me)
Sometimes it seems that the problem is caused by the exhaustion of RAM memory (a lot of program opened or android emulator)