Android X: tools:replace specified at line: for attribute, but no new value specified

冷暖自知 提交于 2019-11-29 00:55:41

I think you are migrating to AndroidX libs.

Add below lines to gradle.properties file

android.useAndroidX=true
android.enableJetifier=true

Remove tools:replace="android:appComponentFactory" from manifest.

Replace android.support.v7.app.AppCompatActivity to androidx.appcompat.app.AppCompatActivity

Migrating to AndroidX

You can try adding:

android:appComponentFactory="android.support.v4.app.CoreComponentFactory"

To the tag <application > in your manifest.

I got same error in my project, I have resolved it You can try it

Android Studio > Refactor > Migrate to AndroidX

In my case, I had updated Firebase and play services dependency, result in this issue.

Reverted back the dependency updates and the error vanished

Seems that the latest Firebase and Play Service dependencies are compatible with androidx.

It often happened because you used Androidx libraries and support libraries at the same time. Some 3rd-party libraries may contain support libraries and other 3rd-party libraries may contain Androidx libraries, this can also lead this problem. If you have gradle environment in you PC, try "gradlew :app:dependencies" command in the terminal of Android Studio, this command will list all libraries including 3rd-party libraries of your project, and see which library or framework used Androidx libraries and which not. Then try to upgrade old libraries used support libraries, and this problem should disappear.

In my case, i was facing problem because of the firebase version i was using. Downgrading the firebase version helped me.

implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' implementation 'com.google.firebase:firebase-core:16.0.6'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!