我在调试中构建项目没有问题。我刚刚安装了一个新的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 \ aapt.exe
  带有参数{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 Task:app:processDebugResources无法执行aapt,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56684063/

10-09 01:35
查看更多