cordova-android报错

301

使用Cordova-android@9.1.0时,编译报错:

> Task :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:app:mergeDebugResources’.
> 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.

直接修改gradle.properties中的配置不行,再次编译又会被还原。

解决办法:

在config.xml的 <platform name=”android”>中添加:

<preference name=”AndroidXEnabled” value=”true” />

留下一个答复

Please enter your comment!
Please enter your name here