gpt4 book ai didi

java - 使用transformClassesWithDexBuilderForDebug在ionic中构建Android失败,进程为okhttp-3.13.1.jar

转载 作者:行者123 更新时间:2023-12-02 01:38:37 24 4
gpt4 key购买 nike

在更新 android studio 后尝试在 ionic 2 中构建 android 平台时,此错误开始出现。

  Ionic Info:

ionic (Ionic CLI) : 4.3.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.9

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 6.4.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 15 other plugins)

System:

NodeJS : v8.12.0 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ’:transformClassesWithDexBuilderForDebug’. >

com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException:

Failed to process /.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.13.1/b49cf3799bd473199e96c4fb9987e9e08395a1c0/okhttp-3.13.1.jar

发现Dexbuilder错误与Java版本8有关。

最佳答案

修改/platforms/android 文件夹中“Build.Gradle”文件中的这些选项解决了问题

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

关于java - 使用transformClassesWithDexBuilderForDebug在ionic中构建Android失败,进程为okhttp-3.13.1.jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54822630/

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