繁体   English   中英

React Native Task:app:processDebugResources无法执行aapt

[英]React Native Task :app:processDebugResources Failed to execute aapt

我在调试中构建项目没有问题。 我刚刚安装了一个新的npm软件包(bugsnag),然后做了react-native链接,现在我无法再构建它了。 我尝试了谷歌的许多建议解决方案,但都没有用。

奇怪的部分,我尝试构建项目的备份文件,并且它的构建也没有出现相同的错误,因此感觉它与其他内容有关吗?

错误细节:

> Task :app:processDebugResources
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt

....

引起原因:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:执行进程C:\\ Users \\ eless \\ AppData \\ Local \\ Android \\ Sdk \\ build-tools \\ 27.0.3 \\时出错带有参数{package -f --no-crunch -IC:\\ Users \\ eless \\ AppData \\ Local \\ Android \\ Sdk \\ platforms \\ android-27 \\ android.jar -M \\?\\ D:\\ React \\ swipe的aapt.exe -app-developp \\ android \\ app \\ build \\ intermediates \\ manifests \\ full \\ debug \\ AndroidManifest.xml -SD:\\ React \\ swipe-app-developp \\ android \\ app \\ build \\ intermediates \\ res \\ merged \\ debug -m- J \\?\\ D:\\ React \\ swipe-app-developp \\ android \\ app \\ build \\ Generated \\ source \\ r \\ debug -FD:\\ React \\ swipe-app-developp \\ android \\ app \\ build \\ intermediates \\ res \\ debug \\ resources-debug.ap_ -D \\?\\ D:\\ React \\ swipe-app-developp \\ android \\ app \\ build \\ intermediates \\ multi-dex \\ debug \\ manifest_keep.txt --custom-package xx.com.xx -0 apk --output-text-symbols \\?\\ D:\\ React \\ swipe-app-developp \\ android \\ app \\ build \\ intermediates \\ symbols \\ debug --no-version-vectors}

Error while executing process C:\Users\eless\AppData\Local\Android\Sdk\build-tools\27.0.3\aapt.exe with arguments

app \\ build.gradle

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'

    defaultConfig {
        applicationId "xx"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 24
        versionName "1.0.23"
        multiDexEnabled true
        ndk {
             abiFilters "armeabi-v7a", "x86"
        }
        manifestPlaceholders = [onesignal_app_id: "xx4",
                                onesignal_google_project_number: "REMOTE"]
    }

dependencies {
    compile project(':bugsnag-react-native')
    compile project(':lottie-react-native')
    compile project(':react-native-fast-image')
    compile project(':react-native-onesignal')
    compile project(':react-native-android-permissions')
    compile project(':react-native-fbsdk')
    compile project(':react-native-vector-icons')
    compile project(':react-native-image-picker')
    compile project(':react-native-iap')
    compile project(':react-native-camera')
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:26.0.2'
    compile 'com.facebook.react:react-native:+'
    compile 'com.android.support:multidex:1.0.0'
    implementation 'com.google.firebase:firebase-core:+'
    // From node_modules
}

好吧,我尝试了不同的方法,并找到了我认为合适的解决方案。

在android / gradle / gradle-wrapper.properties中

我变了

from

distributionUrl = https://services.gradle.org/distributions/gradle-4.1-all.zip

to

distributionUrl = https://services.gradle.org/distributions/gradle-4.6-all.zip

希望对您有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM