任务执行失败':app:processReleaseResources'

时间:2017-10-09 12:27:24

标签: android reactjs react-native react-native-android

我正在尝试创建我的React Native项目的签名APK。

我使用此命令创建发布APK gradlew assembleRelease

始终坚持:app:bundleReleaseJsAndAssets并得到以下错误

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\username\AppData\Local\Android\sdk1\build-tools\25.0.2\aapt.exe'' finished with non-zero exit value 1

我的build.gradle文件看起来像这样

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.appname"
        multiDexEnabled true
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 2
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    signingConfigs {
        release {
            storeFile file('my-release-key.keystore')
            storePassword '********'
            keyAlias 'my-key-alias'
            keyPassword '********'
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release // add this line as well
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

0 个答案:

没有答案