无法为com.android.build.gradle.internal.dsl.BaseAppModuleExtension类型的对象设置未知属性"useAndroidX" [英] Could not set unknown property 'useAndroidX' for object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension

查看:847
本文介绍了无法为com.android.build.gradle.internal.dsl.BaseAppModuleExtension类型的对象设置未知属性"useAndroidX"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加一个我在github上找到的库,但它需要androidx.我发现我应该放这些库:

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

这里

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

}

但是我遇到了这个错误

无法为com.android.build.gradle.internal.dsl.BaseAppModuleExtension类型的对象设置未知属性"useAndroidX".

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

推荐答案

这两个属性需要在项目根目录下的gradle.properties文件中定义,而不是在build.gradle中.

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

这篇关于无法为com.android.build.gradle.internal.dsl.BaseAppModuleExtension类型的对象设置未知属性"useAndroidX"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆