即使未在 android 项目中启用,也会出现 Androidx 库问题
Getting Androidx library issue even though its not enabled in android project
我遇到了这个问题
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.1.0
我一直收到这个错误,我一直在互联网上搜索以找出问题所在,但我找不到任何东西
“而且我不能在我的项目中使用 Androidx 库”
在关于这个问题的许多答案中,建议添加排除 'META-INF/DEPENDENCIES' 和其他一些排除。然而 none 这些对我有用。在我的情况下是这样的:
我在依赖项中添加了这个:
implementation 'androidx.annotation:annotation:1.1.0'
而且我在 gradle.properties 中添加了这个:
android.useAndroidX=true
这两个都是我添加的,因为我遇到了构建错误 'cannot find symbol class Nullable' 并且有人建议将其作为解决此问题的一些答案,例如此处
然而,最终我遇到了错误:
More than one file was found with OS independent path 'androidsupportmultidexversion.txt'
没有排除对我有用。最后我刚刚删除了
implementation 'androidx.annotation:annotation:1.1.0'
来自 build.grdle 文件。
最后我摆脱了这个
( )
"More than one file was found with OS..." build error.
我浪费了几个小时 mine.But 没有找到这个问题的解决方案。
然后我就改变我的项目
minSdkVersion 19
至
minSdkVersion 21
最后我可以毫无错误地构建我的 apk 文件
我遇到了这个问题
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.1.0
我一直收到这个错误,我一直在互联网上搜索以找出问题所在,但我找不到任何东西
“而且我不能在我的项目中使用 Androidx 库”
在关于这个问题的许多答案中,建议添加排除 'META-INF/DEPENDENCIES' 和其他一些排除。然而 none 这些对我有用。在我的情况下是这样的:
我在依赖项中添加了这个:
implementation 'androidx.annotation:annotation:1.1.0'
而且我在 gradle.properties 中添加了这个:
android.useAndroidX=true
这两个都是我添加的,因为我遇到了构建错误 'cannot find symbol class Nullable' 并且有人建议将其作为解决此问题的一些答案,例如此处
然而,最终我遇到了错误:
More than one file was found with OS independent path 'androidsupportmultidexversion.txt'
没有排除对我有用。最后我刚刚删除了
implementation 'androidx.annotation:annotation:1.1.0'
来自 build.grdle 文件。 最后我摆脱了这个
(
"More than one file was found with OS..." build error.
我浪费了几个小时 mine.But 没有找到这个问题的解决方案。 然后我就改变我的项目
minSdkVersion 19
至
minSdkVersion 21
最后我可以毫无错误地构建我的 apk 文件