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

Kyso84 picture Kyso84 · Jul 11, 2018 · Viewed 27.6k times · Source

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

Answer

Rene Ferrari picture Rene Ferrari · Jul 11, 2018

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