Reputation: 865
I have a react-native project and it works ok yesterday for android, But error happens today when i run react-native run-android
. Before I run it on android today ,nothing is changed,only open it in AndroidStudio
. The Error as following:
.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/d1dde4fd0fa50f7f7336597688c557a9/res/values/value s.xml:252:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.
.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/d1dde4fd0fa50f7f7336597688c557a9/res/values/value s.xml:252:5-69: AAPT: error: resource android:attr/ttcIndex not found.
error: failed linking references.
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:processDebugResources'.
Failed to process resources, see aapt output above for details.
And the main config as the following:
"react": "16.6.3",
"react-native": "0.57.8"
gradle plugin:com.android.tools.build:gradle:3.1.0
compileSdkVersion 27
buildToolsVersion "27.0.3"
minSdkVersion 19
targetSdkVersion 27
I spent a lot of time to resolved it, but failed.
Most resolutions are that upgrade android to AndroidX,But i cannot,because my prohect have many dependencies,and some of them are not support AndroidX.
So I want to know why need android:attr/ttcIndex
when i run it.And how to fix it and donot upgapde android version and keep compileSdkVersion 27
Upvotes: 4
Views: 7073
Reputation: 66
This helped me
in the top of file android/gradle.properties
googlePlayServicesVersion=12.0.1
And create new index.android.bundle
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
Upvotes: 5