【问题标题】:Execution failed for task ':app:processDebugResources'. > Android resource linking failed任务 ':app:processDebugResources' 执行失败。 > Android 资源链接失败
【发布时间】:2019-06-27 07:56:56
【问题描述】:

我正在运行react-native run-android,在构建过程中这是我得到的错误。我正在使用最新版本的 android studio。我从react-native init 开始的一个新示例项目在我通过 android 运行它时有效,这告诉我我正确安装了 android studio,但我不知道为什么我无法通过现有项目。

Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  Output:  /Users/arronlinton/LocalStorage/JAST/JAST/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml:69: error: resource mipmap/ic_notif (aka com.jast:mipmap/ic_notif) not found.
  error: failed processing manifest.

build.gradle

buildscript {
    ext {
        buildToolsVersion = "28.0.2"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 27
        supportLibVersion = "28.0.0"
    }

app/build.gradle

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.jast"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    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"
        }
    }
    // 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
            }
        }
    }
}

dependencies {
    compile project(':react-native-vector-icons')
    compile project(':react-native-maps')
    compile project(':react-native-mail')
    compile project(':react-native-linear-gradient')
    compile project(':react-native-image-picker')
    compile project(':react-native-firebase')
    compile project(':react-native-fetch-blob')
    compile project(':react-native-fcm')
    compile project(':react-native-aws')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-maps')
    implementation project(':react-native-mail')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-image-picker')
    implementation project(':react-native-firebase')
    implementation project(':react-native-fetch-blob')
    implementation project(':react-native-fcm')
    implementation project(':react-native-aws')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-maps')
    implementation project(':react-native-mail')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-image-picker')
    implementation project(':react-native-firebase')
    implementation project(':react-native-fetch-blob')
    implementation project(':react-native-fcm')
    implementation project(':react-native-aws')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation "com.google.android.gms:play-services-base:16.0.1"
    implementation "com.google.firebase:firebase-core:16.0.6"
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}

【问题讨论】:

    标签: android android-studio react-native build.gradle


    【解决方案1】:

    根据您的错误,它告诉您您在 AndroidManifest.xml 中使用以下资源 mipmap/ic_notif,但在您的 res 文件夹中找不到它。

    您应该检查您用于资源的名称和引用。特别是您可能用于通知的那个。

    还要检查AndroidManifest.xml 中的关闭标签是否正确,因为错过放置的> 可能会导致错误。

    【讨论】:

      猜你喜欢
      • 2019-06-06
      • 2022-01-04
      • 1970-01-01
      • 2019-10-31
      • 2020-02-28
      • 2019-10-31
      • 2021-05-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多