react-native: AAPT: error: resource android:attr/fontVariationSettings not found.
_~.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\b455673db66bf379c6b553212db86e77\res\values\values.xml:251:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.
~.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\b455673db66bf379c6b553212db86e77\res\values\values.xml:251:5-69: AAPT: error: resource android:attr/ttcIndex not found._
I am facing this issue.
app/build.gradle
android {
compileSdkVersion 28
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.Marian"
minSdkVersion 16
targetSdkVersion 27
versionCode 0016
versionName "marianv0016"
multiDexEnabled true
lintOptions {
abortOnError false
}
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
dependencies {
implementation project(':react-native-gesture-handler')
implementation project(':react-native-push-notification')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.android.support:support-core-utils:27.1.1"
implementation project(':react-native-fcm')
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation ("com.facebook.react:react-native:+") { force = true } // From node_modules
implementation project(':realm')
implementation project(':react-native-fs')
implementation project(':react-native-vector-icons')
implementation project(':react-native-image-picker')
implementation project(':rn-fetch-blob')
implementation project(':react-native-image-crop-picker')
implementation project(':react-native-exit-app')
implementation project(':react-native-onesignal')
implementation project(':react-native-sensor-manager')
implementation project(':react-native-smart-barcode')
implementation project(':react-native-push-notification')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-file-picker')
implementation project(':react-native-doc-viewer')
implementation project(':react-native-svg')
implementation project(":react-native-google-signin")
implementation project(':react-native-spinkit')
implementation project(':react-native-pdf')
}
// apply plugin: 'com.google.gms.google-services'
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '27.1.1'
}
}
}
}
apply plugin: 'com.google.gms.google-services'
build.gradle
buildscript {
ext {
googlePlayServicesAuthVersion = "12.0.1" // <--- use this version or newer
// firebaseVersion ="17.3.4"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:3.2.1'
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
allprojects {
repositories {
google()
mavenLocal()
mavenLocal()
// for modules depending on jitpack.io
maven { url "https://jitpack.io" }
// add this one
maven {
url "https://maven.google.com"
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
// url 'https://maven.google.com'
}
jcenter()
}
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
defaultConfig {
targetSdkVersion 27
}
}
}
}
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
}
}
}
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Why does it happens. Any idea hot to solve this ?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 10
- Comments: 18
Links to this issue
Commits related to this issue
- Apply a temporary fix to AndroidX issues (https://github.com/facebook/react-native/issues/25371\#issuecomment-507020601) — committed to kaerimichi/zaman-app by kaerimichi 5 years ago
Until a fix for this comes, use the below procedure to fix the issue.
This happened because Google upgraded libraries for androidX and few react native projects also started supporting it. React Native version 0.60.0 will get support for these libraries, maybe not below that. So you have to use the lower versions for those android libraries. To solve, follow the procedure below.
Search for androidX in the output. Get all the libraries having androidx. 2. Make a change in build.gradle inside android/app
These were the libraries that caused problem in my react native project. Google maintains all the releases here https://developers.google.com/android/guides/releases#may_07_2019 . You can choose any other version also. This solution solved issue in my case. Let me know if this helps.
IF your project is on SDK version 27 simply add
googlePlayServicesVersion=12.0.1
on top of the android/gradle.properties file.@shreyakupadhyay Thanks, this solution solve my problem. I can compile my app but I couldn’t generate apk =( So, I put this code in android/build.gradle:
Everything works now!
@shreyakupadhyay Thanks, your solution really works! I tried to resolve this issue for days, including upgrade sdkVersion to 28, and migrate to AndroidX in Android Studio. It can compile successfully but the result apk miss index.bundle.js 。
Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?
👉 Click here if you want to take another look at the Bug Report issue template.
I would like to thankyou for this. days of trying different things
In my case I changed this
implementation project(':react-native-push-notification')
tocompile project(':react-native-push-notification')
and disabled the androidx implementation completely.and then I followed this thread : https://github.com/zo0r/react-native-push-notification/pull/1092
I am getting this issue as well when I run
react-native run-android
.You can download a copy of the reproducible app here: https://www.dropbox.com/s/ygyrhnno8aou4jg/RNsampleApp.zip?dl=0