gpt4 book ai didi

android-studio - 错误 : This project uses AndroidX dependencies, 但 'android.useAndroidX' 属性未启用。在 gradle.prop 中将此属性设置为 true

转载 作者:行者123 更新时间:2023-12-03 03:17:06 31 4
gpt4 key购买 nike

我想使用 firebase 远程配置库(com.google.firebase:firebase-config:19.1.4)。当我将它的依赖项添加到应用程序 gradle 中时,出现以下错误。

    ERROR: This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.versionedparcelable:versionedparcelable:1.0.0, androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.core:core:1.0.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.1.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0
Affected Modules: app

我的应用程序gradle如下:

android {
compileSdkVersion 27
defaultConfig {
applicationId "in.co.gramafone.client"
minSdkVersion 16
targetSdkVersion 27
versionCode 19
versionName "1.1.1"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
...
}

我广泛使用 android 支持库(com.android.support:appcompat-v7:27.1.1)。所以,如果我通过在下面的行中启用 androidX 来解决这个问题,就会报告很多其他库冲突(如果需要这些错误,我可以发布)

android.useAndroidX=true
android.enableJetifier=true

如果需要任何其他信息来了解实际问题,请告诉我。

注意:我是android世界的新手

最佳答案

android.useAndroidX=true

android.enableJetifier=true

您需要将这些添加到 Gradle Scripts 文件夹中的 gradle.properties 文件中。

我不是 100% 确定,但这应该有效。

关于android-studio - 错误 : This project uses AndroidX dependencies, 但 'android.useAndroidX' 属性未启用。在 gradle.prop 中将此属性设置为 true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62115446/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com