Unable to select 'settings activity' in android studio

你说的曾经没有我的故事 提交于 2020-03-19 06:11:11

问题


I am following the tutorial (9.2), it asks to add a 'settings activity', when i try to select it, it is greyed out and says that it 'requires androidx support'. I can find no reference to androidx support in the tutorial and have tried googling the problem to no avail. I have even loaded the completed project from the master files to compare their code with mine, i can find no reference to androidx. I am using android studio 3.4.1


回答1:


As it says, it requires androidx support. You need to enable AndroidX in your project. Add these two lines to your gradle.properties file:

android.useAndroidX=true
android.enableJetifier=true

Setting these two gradle plugin flags to true means that Android Plugin will use appropriate AndroidX library instead of support Library & will rewrite their binaries. Also note that, since you need to use AndroidX in this project, you need to set the compile SDK to Android 9.0 (API level 28) or higher.

For knowing more how to migrate an entire project to AndroidX, please follow this link



来源:https://stackoverflow.com/questions/56550431/unable-to-select-settings-activity-in-android-studio

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