当前位置: 首页 > 知识库问答 >
问题:

进程“command”f:\android-sdk\build-tools\21.1.2\aapt.exe“已完成,退出值为非零1

范兴文
2023-03-14
// 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')
}

我不能建我的项目。我得到了这个错误:

共有1个答案

顾昊穹
2023-03-14

我曾经遇到过这种问题,但我不记得具体如何解决它。
我记得,我遵循这个链接
这似乎是因为有许多模块依赖于差异支持-V4库。因此添加multidexenabled true可能会起作用。

还要尝试将所有模块的依赖关系设置为同一版本的Support-V4。您可以查看这些链接,了解如何排除编译v4 link1 link2 Link3
如果它仍然不起作用,请尝试清除project,重新启动Studio,甚至重新启动您的计算机(我不知道为什么,但这对我起过作用)

希望这有帮助。

 类似资料: