gpt4 book ai didi

android-studio - android.useAndroidX 属性未启用,为什么要启用?

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

我遇到了 androidDx 库的问题,所以当我将 shimmer 库添加到我的项目或 glide 照片库时,或者当我将 google play 服务广告更新到 19.1.0 时,它一直要求我启用 android dx

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.annotation:annotation:1.0.1

但我不想启用它,还是必须启用它?

这是我的gradle文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "folo.new.test.my"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
multiDexEnabled true
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.facebook.shimmer:shimmer:0.5.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.volley:volley:1.1.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.android.gms:play-services-ads:17.1.3'
implementation 'org.jsoup:jsoup:1.10.3'
}

最佳答案

android.useAndroidX=true 添加到 gradle.properties 文件中。

我从这个 link 找到了解决方案.

关于android-studio - android.useAndroidX 属性未启用,为什么要启用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61444926/

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