【问题标题】:Process 'command 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe'' finished with non-zero exit value 1Process 'command 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe'' 以非零退出值 1 结束
【发布时间】:2018-04-25 13:17:50
【问题描述】:

所以每次我尝试在 android studio 上同步我的项目时都会遇到这个错误

错误

Process 'command 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe'' 以非零退出值 1 结束

这是我的 build.grable 文件

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'

我今天拥有最新版本的 android studio

我的 android 工作室出现了一些问题。我正在使用最新版本的 Android Studio,但它仍然给我在 gradle build 上的错误。关于如何解决此问题的任何想法?

【问题讨论】:

标签: android build.gradle


【解决方案1】:

我昨天遇到了这个问题。不知道该怎么做。 所以谷歌它。但无论我遇到什么材料,没有确切的解决方案。,似乎不同的东西适用于不同的人。

这是我的观察,可以节省您的时间。 1. 请确认您是否在任何地方弄乱了字符串、尺寸、颜色或布局 xml 文件等资源。

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

即使是干净的构建也无法正常工作,之后仍然出现相同的错误 每次重建/清理。

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

希望这会有所帮助。

【讨论】:

    【解决方案2】:

    首先尝试从 Build 菜单清理和重建您的项目。

    第 1 步:转到 构建 -> 清理项目

    第 2 步:转到 构建 -> 重建项目

    这应该可以解决您的问题。

    否则尝试从 SDK 管理器更新 Android SDK 构建工具并修改您的 build.gradle 以使用最新的 buildToolsVersion,即现在的“27.0.3”

    【讨论】:

    • 我这样做了,它大部分时间都可以工作,但这次没有,正如您所见,我的 buildToolsVersion 是“25.0.2”
    • 将 buildToolsVersion 更改为 27.0.3 并重试
    • 再次出现同样的错误 "Process 'command 'C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\27.0.3\aapt.exe'' 以非零退出完成值 1"
    猜你喜欢
    • 2016-07-14
    • 1970-01-01
    • 2015-11-03
    • 1970-01-01
    • 2018-10-17
    • 1970-01-01
    • 2019-06-30
    • 2018-12-04
    • 2021-10-20
    相关资源
    最近更新 更多