Could not set unknown property 'useAndroidX' for object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension

自作多情 提交于 2020-05-25 10:41:25

问题


I want to add a library that i've found on github but it required androidx.I found out that i should put these:

android.useAndroidX=true
android.enableJetifier=true

here

defaultConfig {
    applicationId "com.kolydas.greeksinbrno"
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    android.useAndroidX=true
    android.enableJetifier=true

}

But i got this error

Could not set unknown property 'useAndroidX' for object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.


回答1:


Those two properties need to be defined in a gradle.properties file at the root of your project, not in your build.gradle.



来源:https://stackoverflow.com/questions/53857191/could-not-set-unknown-property-useandroidx-for-object-of-type-com-android-buil

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