簡體   English   中英

進程'命令'F:\\ android-sdk \\ build-tools \\ 21.1.2 \\ aapt.exe''以非零退出值1結束

[英]Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1

這是我的build.gradle文件的內容:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
   maven {
        credentials {
            username artifactoryUserName
            password artifactoryPassword
        }

        url 'http://test:8081/artifactory/libs-release-local'
    }
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.1.0'
}
allprojects {
repositories {
    maven {
        credentials {
            username artifactoryUserName
            password artifactoryPassword
        }
        url 'http://test:8081/artifactory/libs-release-local'
    }
    mavenCentral()
    maven { url 'http://repo1.maven.org/maven2' }
    jcenter()
} }

以下是app\\build.gradle的內容:

    apply plugin: 'com.android.application'
    android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"
    lintOptions {
        abortOnError false
    }
    defaultConfig {
        applicationId "test.com"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    signingConfigs {

        aseeConfig {
            storeFile file("test.keystore")
            storePassword "test123"
            keyAlias "AndroidKey"
            keyPassword "test123"
        }

    }

    buildTypes {
        release {
            signingConfig signingConfigs.aseeConfig
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        prod.initWith(buildTypes.release)
        prod {
            signingConfig signingConfigs.aseeConfig
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    } }

    dependencies {
    //compile 'com.google.android:support-v4:r13'
    compile 'com.google.android:google-play-services:4.1.32'
    compile 'com.devsmart.android:devsmart-lib:1.0.0'
    compile 'com.jeremyfeinstein.slidingmenu.lib:sliding-menu:1.0.0'
    compile 'com.viewpagerindicator:viewpager-indicator:2.4.1'
    ///compile 'com.google.android.gms:google-play-services_lib:4.1.32'
    compile 'com.emilsjolander:sticky-list-headers:1.0.0'
    //compile 'com.actionbarsherlock:actionbar-sherlock:4.2.0'
    compile 'com.mobeta.android.dslv:drag-sort-list-view:0.6.1'
    compile 'com.threegvision.products:inigma_sdk_pro:3.24'

    compile 'org.afree:a-free-chart:1.0.0'
    compile 'org.afree:a-free-graphics:1.0.0'
    compile 'net.simonvt:datepicker:1.0'
    //compile 'eu.inmite:android-styled-dialogs:1.1'
    compile 'com.nineoldandroids:nine-old-androids:2.4.1'

    compile 'com.shinobicontrols.charts:shinobicharts:1.5.0-5'
    compile 'com.squareup.picasso:picasso:2.3.2'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.github.bumptech.glide:glide:3.6.0'
    compile 'com.journeyapps:zxing-android-embedded:3.0.1@aar'
    compile 'com.google.zxing:core:3.2.0'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/actionbarsherlock-4.2.0.jar')
    compile files('libs/android-styled-dialogs-1.1.1-sources.jar')
    compile files('libs/android-support-4.0.jar')
}

我無法建立我的項目。 我收到此錯誤:

我曾經遇到過這種問題,但我不記得究竟如何解決它。
我記得,我按照這個鏈接
這似乎是因為有許多模塊依賴於差異支持-v4 lib。 所以添加multiDexEnabled true可能有效。

還嘗試將所有模塊的依賴關系設置為相同版本的support-v4。 你可以看看這些鏈接已知如何排除編譯v4 link1 link2 link3
如果它仍然不起作用,嘗試清理項目,重新啟動Studio,甚至重新啟動計算機(我不知道為什么但這對我有用)

希望這可以幫助。

通常,這是因為您的模塊中存在資源沖突。 例如 ,您的應用程序中有兩個ic_launcher.png (一個來自模塊,另一個來自您的應用)

我搜索檢查資源沖突但我沒有找到官方解決方案。

我只是通過這種方式解決了,刪除每個模塊並測試它是否存在沖突。 這是最簡單的解決方法。 我希望這能幫到您。

以下是另一個建議....

我也發現這種方式,一個人(我不記得名字)使用安全刪除檢查沖突。

而一些Q&A說,要添加multiDexEnabled:true 該配置是增加dex文件大小。 您還可以使用multidex支持庫

Dalvik可執行規范將單個DEX文件中可引用的方法總數限制為65,536,包括Android框架方法,庫方法和您自己的代碼中的方法。 超過此限制要求您配置應用程序構建過程以生成多個DEX文件,稱為多索引配置。

這是multiDex的鏈接:
https://developer.android.com/tools/building/multidex.html

但文檔說你應該小心使用它。

在build.gradle文件中設置compileSdkVersion 20.0.0buildToolsVersion“21.0.0”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM