我正在运行react-native run-android
,在构建期间,这是我得到的错误。我正在使用最新版本的android studio。当我通过android运行它时,我以react-native init
开头的一个新示例项目可以正常工作,这告诉我我已经正确安装了android studio,但是我却在说为什么我无法通过现有项目。< / p>
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'
}
答案 0 :(得分:1)
从您的错误中得知,您正在mipmap/ic_notif
中使用以下资源AndroidManifest.xml
,但是在res
文件夹中找不到该资源。
您应该检查用于资源的名称和引用。特别是您可能用于通知的一种。
还请检查您的AndroidManifest.xml
中的关闭标签是否正确,因为错过的>
可能会导致错误。