Android 尝试使用ionic构建Cordova应用程序时发生Gradle错误
我无法构建我的Ionic项目,当我运行Android 尝试使用ionic构建Cordova应用程序时发生Gradle错误,android,angular,cordova,ionic-framework,gradle,Android,Angular,Cordova,Ionic Framework,Gradle,我无法构建我的Ionic项目,当我运行Ionic cordova build android时,它会发生: > Task :app:mergeLibDexDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeLibDexDebug'. > Could not resolve all files for configu
Ionic cordova build android
时,它会发生:
> Task :app:mergeLibDexDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeLibDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform classes.jar (project :CordovaLib) to match attributes {artifactType=android-dex, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.api.attributes.VariantAttr=debug, dexing-enable-desugaring=false, dexing-incremental-desugaring-v2=false, dexing-is-debuggable=true, dexing-min-sdk=22, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for DexingNoClasspathTransform: /home/terry/Documentos/Viitra/app/platforms/android/CordovaLib/build/intermediates/runtime_library_classes_jar/debug/classes.jar.
> Error while dexing.
The dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle
android {
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
See https://developer.android.com/studio/write/java8-support.html for details. Alternatively, increase the minSdkVersion to 26 or above.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
已经尝试过该解决方案以添加java-8支持,但它已经存在所有my build.gradle文件:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
以下是我的库的版本:
离子型:
Ionic CLI:6.13.1(/usr/local/lib/node_modules/@Ionic/CLI)
离子骨架:@Ionic/angular 4.11.13
@角度开发套件/构建角度:0.803.29
@角度devkit/示意图:8.1.3
@角度/cli:8.1.3
@离子/角度工具包:2.3.3
科尔多瓦:
Cordova CLI:10.0.0
Cordova平台:不可用
Cordova插件:不可用
实用程序:
cordova res(可用更新:0.15.3):0.8.1
本机运行(可用更新:1.3.0):0.3.0
系统:
Android SDK工具:26.1.1(/home/terry/Android/SDK)
NodeJS:v12.19.0(/var/lib/snap/snap/node/3292/bin/node)
净现值:6.14.8
操作系统:Linux 5.10
编辑:
修复了更改package.json文件、降级Cordova Android版本的问题。在Android studio中打开此应用程序并运行
gradle
好的,我会尝试将输出添加到帖子中