Androidx modules, android:attr/ttcIndex & android:attr/fontVariationSettings not found-ThrowExceptions

Exception or error:

I’m migrating all my support/appcompat libraries to androidx.
After all updates I can’t build my project because of this error

:app:processDebugManifest UP-TO-DATE
AGPBI: {"kind":"error","text":"error: resource android:attr/fontVariationSettings not found.","sources":[{"file":"/Users/xxx/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/7cae290a69b05f5ffc25283e26a7eb4a/res/values/values.xml","position":{"startLine":250,"startColumn":4,"startOffset":27058,"endColumn":68,"endOffset":27122}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: resource android:attr/ttcIndex not found.","sources":[{"file":"/Users/xxx/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/7cae290a69b05f5ffc25283e26a7eb4a/res/values/values.xml","position":{"startLine":250,"startColumn":4,"startOffset":27058,"endColumn":68,"endOffset":27122}}],"original":"","tool":"AAPT"}
:app:processDebugResources

I tried to include one by one all my dependencies to identify which one is causing the issue. I was able to build only if I remove the Room library ¯\_(ツ)_/¯

https://developer.android.com/topic/libraries/architecture/adding-components#room

It’s weird because issue seems to come from styling-ish resources, but room is just a database library.

Is anyone have any ideas or solution to include room without breaking everything ?

===============================

my conf:

compileSdkVersion 27
buildToolsVersion 27.0.3

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 27
}

dependencies {
    // ROOM
    implementation ('androidx.room:room-runtime:' + androidxRoomVersion)
    implementation ('androidx.room:room-rxjava2:' + androidxRoomVersion)
    implementation ('androidx.room:room-guava:' + androidxRoomVersion)
    kapt ('androidx.room:room-compiler:' + androidxRoomVersion)
}

with: androidxRoomVersion = 2.0.0-alpha1

How to solve:

Set your compileSdkVersion 'android-P' and targetSdkVersion 28

EDIT: Now compileSdkVersion 28 should also work meaning you no longer have to set it to android-P

###

Change compileSdkVersion as ‘android-28′
Change targetSdkVersion as ’28’

###

If anyone else has stumbled upon this problem due to getting this error recently out of nowhere in your previously working fine react native projects – this is due to the latest BREAKING CHANGE in Google Play service and Firebase. Specially you will have problem with the packages which are dependent on –

com.google.android.gms:play-services-gcm

Check this thread first –

https://github.com/facebook/react-native/issues/25293

And solution would mostly be like this –

https://github.com/facebook/react-native/issues/25293#issuecomment-503045776

Leave a Reply

Your email address will not be published. Required fields are marked *