java - react native 任务:app:processDebugResources Failed to execute aapt

标签 java android react-native

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

奇怪的是,我试图构建我的项目的备份文件,但它没有构建也出现相同的错误,所以感觉它与其他东西有关?

错误详细信息:

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

...

Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\eless\AppData\Local\Android\Sdk\build-tools\27.0.3\aapt.exe with arguments {package -f --no-crunch -I C:\Users\eless\AppData\Local\Android\Sdk\platforms\android-27\android.jar -M \?\D:\React\swipe-app-developp\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\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 -F D:\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

希望对你有帮助..

关于java - react native 任务:app:processDebugResources Failed to execute aapt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56684063/

相关文章:

android - 预览未在Android Studio 3.1.4中显示

java - Apache POI : API to identify tables in the excel sheet and read them

java - 是否可以获取对 Java 方法的引用以便稍后调用它?

android - 使用 Mockito 对 RecyclerView 适配器进行单元测试

java - Android XML 解析器显示重复数据

android - 一直 react native 空屏幕

ios - React Native/Swift Native 模块只能工作一次

react-native - react native : Fix TextInput at the bottom of the screen with a ScrollView

java - 没有时区的 Jaxb DateTime

java - 如何在公共(public)库中使用使用 Spring 的 jar?