Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 753
Kyso84 Avatar asked Jul 11 '18 17:07

Kyso84


3 Answers

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

like image 67
Rene Ferrari Avatar answered Sep 19 '22 03:09

Rene Ferrari


Change compileSdkVersion as 'android-28' Change targetSdkVersion as '28'

like image 38
Osman Yalın Avatar answered Sep 19 '22 03:09

Osman Yalın


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

like image 33
Anirudha Paul Avatar answered Sep 20 '22 03:09

Anirudha Paul