Cin*_*com 3 android gradle kotlin android-studio androidx
这是我的错误;
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.fragment:fragment:1.0.0,
androidx.versionedparcelable:versionedparcelable:1.0.0,
androidx.slidingpanelayout:slidingpanelayout:1.0.0
...
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题?我从我的 gradle 文件和我从类中导入的库中删除了所有 androidx 库。我不想使用androidx。
小智 8
首先打开你的项目gradle 脚本>> 然后打开gradle.properties最后粘贴这两行代码
android.useAndroidX=true
android.enableJetifier=true
Run Code Online (Sandbox Code Playgroud)
在 Cordova 项目中执行此操作的最简单方法是打开 config.xml 文件并在 <platform name="android"> 标记中添加以下内容。
<preference name="AndroidXEnabled" value="true" />
Run Code Online (Sandbox Code Playgroud)
这样,如果您删除并重新添加 Android 平台,您将不必返回 gradle.properties 并手动编辑它。(此外,每次我输入“cordova build android”时,我的 gradle.properties 似乎都会被覆盖,因此直接编辑它对我来说无论如何都不起作用。)
祝你好运。
小智 5
cordova 插件添加 cordova-plugin-androidx
cordova 插件添加 cordova-plugin-androidx-adapter
然后构建您的应用程序。
| 归档时间: |
|
| 查看次数: |
20101 次 |
| 最近记录: |