- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
每次尝试构建 apk 时,我都会遇到同样的错误。我也尝试使用 PhoneGap Build,但无济于事。我检查过,我使用的 API 版本没问题,Java SDK 是最新的。我不确定问题出在哪里,也许是我正在使用的插件之一?我还尝试删除平台并重新添加并运行 cordova clean。
$ cordova build android --debug
ANDROID_HOME=/Users/awhiteman/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
:wrapper
BUILD SUCCESSFUL
Total time: 0.723 secs
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_a80icgrgnmo2xiao0mubf7grh.run(/Users/awhiteman/Desktop/Dev-Systems-App/platforms/android/build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportSupportCompat2600Alpha1Library
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library
:prepareComAndroidSupportSupportFragment2600Alpha1Library
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library
:prepareComAndroidSupportSupportV42600Alpha1Library
:prepareOrgApacheCordovaCordovaLib623DebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.076 secs
Error: /Users/awhiteman/Desktop/Dev-Systems-App/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
最佳答案
Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl
这表示多个版本的 Android 支持库导致了冲突。很可能您有 2 个或更多插件通过它们的 Gradle 配置请求不同的版本。最简单的解决方案是添加 cordova-android-support-gradle-release插件到您的 Cordova 项目,这将强制 Gradle 在所有情况下使用相同的版本:
cordova plugin add cordova-android-support-gradle-release
关于android - Cordova Android 构建错误 :transformClassesWithDexForDebug FAILED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44826962/
Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC
经过多次尝试使用其他网络解决方案后,我感到绝望。 如果有人可以帮助我解决这个问题,我会更开心! 错误:任务':app:transformClassesWithDexForDebug'的执行失败。 co
我不明白为什么会出现此错误。我下载了 Android 1.5.1 并安装了 jdk 7,但每当我运行 hello world 应用程序时,它都不会调试并显示以下错误 错误:任务“:app:transf
构建我的 Android 应用大约需要 90 秒(“快”),每次更新代码最多需要 3 分钟。这完全是浪费时间,因为我认为解决方案一定是触手可及的。我尝试调查这个问题,发现了不同的博客文章和带有建议的答
在我执行命令“ionic build android”之前,一切都很好并且工作完美然后出现这个错误。 :transformClassesWithDexForDebugjava.lang.Unsuppo
我正在编译 multidex 项目,而 gradle 给了我这个: Execution failed for task ':Project:transformClassesWithDexForLite
在SO上似乎有很多类似的问题,我已经尝试了许多解决方案,但都没有奏效。 在Android Studio中,当我尝试在物理设备或模拟器上运行我的应用程序时,gradle构建失败,并出现以下错误: Err
这是我的梯度: apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsV
我在编译新项目时遇到问题。我第一次遇到这个问题,互联网上没有这样的解决方案。我搜索了很多但没有找到任何解决方案。你能帮帮我吗? 我的日志: Information:Gradle tasks [:app
在我的应用程序中,我想使用 Firebase作为后端。我也支持 Facebook 和 Google 登录。在依赖项中添加 Firebase 之前,我的项目编译成功,但在添加 Firebase 之后,出
gradle有问题,我的应用程序无法编译,并在“0:Messages”选项卡上显示此错误,这是我在build.gradle(app)上的代码 apply plugin: 'com.android.ap
我在android studio中收到此错误 Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com
我正在使用 Camera2Basic example由 Google 在 Android Studio 中测试应用程序。运行项目时出现此错误: Error:Execution failed for t
我正在尝试执行代码,但我在 gradle build 消息中收到错误消息 Execution failed for task ':app:transformClassesWithDexForDebu
我在这里看了很多线程,但仍然没有找到可行的解决方案。 当我想要构建 APK 时,出现了这个主要错误: Error:Execution failed for task ':app:transformCl
每次尝试构建 apk 时,我都会遇到同样的错误。我也尝试使用 PhoneGap Build,但无济于事。我检查过,我使用的 API 版本没问题,Java SDK 是最新的。我不确定问题出在哪里,也许是
构建失败 总时间:1分10.277秒失败:构建失败并出现异常。 出了什么问题:任务“:transformClassesWithDexForDebug”执行失败。 com.android.build.a
我将要构建apk时遇到此错误。 Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.buil
当我运行我的应用程序时,Android Studio 抛出以下错误: Error:Execution failed for task ':app:transformClassesWithDexForD
我在 android studio 的 android 项目中工作,当我开始运行 gradle build 并显示以下错误。谁帮我看看是什么问题 Error:Execution failed for
我是一名优秀的程序员,十分优秀!