任务':app:processDebugResources'的执行失败。 > Android资源链接失败 [英] Execution failed for task ':app:processDebugResources'. > Android resource linking failed
问题描述
我正在运行 react-native run-android
,在构建期间,这是我得到的错误。我正在使用最新版本的android studio。我以 react-native init
开头的一个新示例项目在通过Android运行时有效,这告诉我我正确安装了android studio,但我却简短说明了为什么我无法处理现有项目。
I'm running react-native run-android
and during the build this is the error I get. I'm using the latest version of android studio. A fresh example project I started with react-native init
works when I run it via android so that tells me I installed android studio correctly, but I'm coming up short on why I can't get through with an existing project.
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
build.gradle
buildscript {
ext {
buildToolsVersion = "28.0.2"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}
app / build.gradle
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'
}
推荐答案
从您的错误中得知您正在使用以下资源 mipmap / ic_notif
在您的 AndroidManifest.xml
中,但它无法在 res
文件夹中找到。
From your error it is telling you that you are using the following resource mipmap/ic_notif
in your AndroidManifest.xml
but it cannot find it in your res
folder.
您应该检查用于资源的名称和引用。特别是您可能用于通知的那个。
You should check that names and references that you are using for your resources. Specifically the one that you are probably using for notifications.
还要检查您的 AndroidManifest.xml
中的关闭标签是否正确,作为丢失的>
可能会导致错误。
Also check that your close tags are correct in your AndroidManifest.xml
as a missed placed >
can cause errors.
这篇关于任务':app:processDebugResources'的执行失败。 > Android资源链接失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!