运行react-native run-android后出现错误-
失败:构建失败,并出现异常。
Execution failed for task ':app:processDebugResources'.
>
Android resource linking failed
Output: /../../bitbucket/app/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:293: error: resource android:attr/fontVariationSettings not found.
/../../bitbucket/app/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:293: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: /../../.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/5a5e4d34c69b7e8b3552937157493c40/aapt2-3.2.1-4818971-osx/aapt2 link -I\
/../../Library/Android/sdk/platforms/android-27/android.jar\
--manifest\
/../../bitbucket/app/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
-o\
/../../bitbucket/app/android/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
-R\
@/../../bitbucket/app/android/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
/../../bitbucket/app/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
--custom-package\
com.app\
-0\
apk\
--output-text-symbols\
/../../bitbucket/app/android/app/build/intermediates/symbols/debug/R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
Output: /../../.gradle/caches/transforms-1/files-1.1/drawee-1.10.0.aar/ac1ce9b9fcfb8b8c996ede4ab043d5d6/res/values/values.xml:3:5-58:857: AAPT: error: resource android:attr/fontVariationSettings not found.
/../../.gradle/caches/transforms-1/files-1.1/drawee-1.10.0.aar/ac1ce9b9fcfb8b8c996ede4ab043d5d6/res/values/values.xml:3:5-58:857: AAPT: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: /../../.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/5a5e4d34c69b7e8b3552937157493c40/aapt2-3.2.1-4818971-osx/aapt2 link -I\
/../../Library/Android/sdk/platforms/android-27/android.jar\
--manifest\
/../../bitbucket/app/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
-o\
/../../bitbucket/app/android/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
-R\
@/../../bitbucket/app/android/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
/../../bitbucket/app/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
--custom-package\
com.app\
-0\
apk\
--output-text-symbols\
/../../bitbucket/app/android/app/build/intermediates/symbols/debug/R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整的见解。
在https:/help.gradle.org
47秒内失败 73个可执行任务:72个已执行,其中1个是最新的
我已经更新了sdk版本和react-native-device-info版本。仍然面临问题。
依赖项:app / build.gradle:
dependencies
{
compile project(':react-native-wheel-picker')
compile project(':react-native-vector-icons')
compile project(':react-native-image-picker')
compile project(':react-native-geolocation-service')
compile project(':react-native-fused-location')
compile project(':react-native-android-open-settings')
compile project(':react-native-gesture-handler')
compile project(':react-native-fs')
compile project(':react-native-device-info')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
compile 'com.android.support:multidex:1.0.3'
}
android / build.gradle:
buildscript
{
ext
{
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 26
supportLibVersion = "26.1.0"
googlePlayServicesVersion = "16.+"
}
repositories
{
google()
jcenter()
}
dependencies
{
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:1.4.0-beta3'
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
}
}
}
}
wrapper {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}