0

So I am having this error every time I try to sync my project on android studio

The error

Process 'command 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe'' finished with non-zero exit value 1

Here is my build.grable file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.newcoderplus.moneymachinecash"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 2
        versionName "2.0"
        multiDexEnabled = true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        javaMaxHeapSize "2g"
    }
    packagingOptions {
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/MANIFEST.MF'
    }
}

repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
    maven { url 'http://dl.bintray.com/amulyakhare/maven' }
    maven { url "https://bitbucket.org/adscend/androidsdk/raw/master/" }
    maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
    maven { url "http://dl.bintray.com/ironsource-mobile/android-adapters" }

}

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(':fragmentation_swipeback')
    compile files('libs/AdxmiSdk_v6.0.0_2016-10-21.jar')
    compile files('libs/NativeXMonetizationSDK_v5.5.9.jar')
    compile files('libs/gson-2.3.1.jar')
    compile files('libs/applovin-sdk-7.0.3.jar')
    compile files('libs/SuperRewards-3.1b.jar')
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.jakewharton:butterknife:8.5.1'
    compile 'com.github.GrenderG:Toasty:1.1.3'
    compile 'uk.co.chrisjenx:calligraphy:2.2.0'
    compile 'com.afollestad.material-dialogs:core:0.9.4.1'
    compile 'com.jude:easyrecyclerview:4.4.0'
    compile 'com.jude:rollviewpager:1.4.6'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'jp.wasabeef:glide-transformations:2.0.2'
    compile 'me.yokeyword:fragmentation:0.10.4'
    compile 'com.github.medyo:android-about-page:1.2'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile group: 'com.backendless', name: 'backendless', version: '4.0.0-beta3'
    compile 'com.google.android.gms:play-services-ads:10.2.1'
    compile 'com.google.android.gms:play-services-base:10.2.1'
    compile 'com.google.android.gms:play-services-location:10.2.1'
    compile 'com.adcolony:sdk:3.1.2'
    compile 'com.ironsource.adapters:admobadapter:3.0.2@jar'
    compile 'com.ironsource.sdk:mediationsdk:6.5.3@jar'
    compile project(':fragmentation_swipeback')
    compile files('libs/AdxmiSdk_v6.0.0_2016-10-21.jar')
    compile files('libs/NativeXMonetizationSDK_v5.5.9.jar')
    compile files('libs/gson-2.3.1.jar')
    compile files('libs/applovin-sdk-7.0.3.jar')
    compile files('libs/SuperRewards-3.1b.jar')
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.1'
            }
        }
    }
}



apply plugin: 'com.google.gms.google-services'

I have the lastest version of android studio as of today

Something is not working with my android studio. I am using latest version of Android studio, still it gives me error on gradle build. Any ideas on how I can resolve this problem ?

Arshad
  • 1,262
  • 16
  • 25
Zakaria
  • 65
  • 1
  • 3
  • 13

2 Answers2

2

I had this issue yesterday. with no clue what to do. So google it. But whatever material I came across, had no exact solution for the prob., seems like different things were working for different people.

Here is my observation that can save your time. 1. Please verify, if you've messed anywhere with resources like strings, dimens, colors or in layout xml files.

By mistake I created some prob. with my strings xml file along with layout file.

Even clean build was not working, the same error kept popping after every rebuild/clean.

You have to look closely, to identify the prob. with your code.

Hope this helps.

MobileEvangelist
  • 2,583
  • 1
  • 25
  • 36
1

First try to clean and rebuild your project from Build menu.

Step 1: go to Build -> Clean Project

Step 2: go to Build -> Rebuild Project

This should solve your problem.

Otherwise try updating Android SDK build tool from SDK manager and modify your build.gradle to use latest buildToolsVersion i.e "27.0.3" as of now

SAYE
  • 1,247
  • 2
  • 20
  • 47
  • i did this and it work most of times but this time it didn't and as you see my buildToolsVersion is "25.0.2" – Zakaria Apr 25 '18 at 13:32
  • change buildToolsVersion to 27.0.3 and try again – SAYE Apr 25 '18 at 13:33
  • 1
    same error again "Process 'command 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\27.0.3\aapt.exe'' finished with non-zero exit value 1 " – Zakaria Apr 25 '18 at 13:37