Ionic App出错:任务执行失败':transformDexWithDexForRelease'

时间:2018-03-06 09:54:16

标签: android cordova ionic-framework gradle terminal

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_14nw1tmmrdvevki8jo499flje.run(/home/chaitanya/Videos/feb27/client/ionic/platforms/android/build.gradle:142)
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
:preBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:processReleaseManifest
:preReleaseBuild
:CordovaLib:compileReleaseAidl
:compileReleaseAidl
:CordovaLib:packageReleaseRenderscript NO-SOURCE
:compileReleaseRenderscript
:checkReleaseManifest
:generateReleaseBuildConfig
:prepareLintJar UP-TO-DATE
:generateReleaseResValues
:generateReleaseResources
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:mergeReleaseResources
:createReleaseCompatibleScreenManifests
:processReleaseManifest
:splitsDiscoveryTaskRelease
:CordovaLib:platformAttrExtractor
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:prepareLintJar UP-TO-DATE
:CordovaLib:javaPreCompileRelease
:CordovaLib:processReleaseJavaRes NO-SOURCE
:compileReleaseNdk NO-SOURCE
:mergeReleaseShaders
:compileReleaseShaders
:generateReleaseAssets
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:mergeReleaseAssets
:mergeReleaseJniLibFolders
:CordovaLib:compileReleaseNdk NO-SOURCE
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNativeLibsWithMergeJniLibsForRelease
:CordovaLib:transformNativeLibsWithIntermediateJniLibsForRelease
:processReleaseJavaRes NO-SOURCE
:CordovaLib:processReleaseResources
:processReleaseResources
:generateReleaseSources
:CordovaLib:generateReleaseSources
:CordovaLib:compileReleaseJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease
:javaPreCompileRelease
:compileReleaseJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/chaitanya/Videos/feb27/client/ionic/platforms/android/src/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint: unchecked for details.

:compileReleaseSources
:transformClassesWithPreDexForRelease
:transformDexWithDexForRelease FAILED

FAILURE: Build failed with an exception.
  • 出了什么问题: 任务':transformDexWithDexForRelease'执行失败。

      

    com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:com.android.dex.DexException:多个dex文件定义Lokhttp3 / Address ;

  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info--debug选项运行以获得更多日志输出。

  • https://help.gradle.org

  • 获取更多帮助
BUILD FAILED in 4s
39 actionable tasks: 37 executed, 2 up-to-date
Error: /home/chaitanya/Videos/feb27/client/ionic/platforms/android/gradlew:
     

命令失败,退出代码为1错误输出:       注意:某些输入文件使用或覆盖已弃用的API。       注意:使用-Xlint重新编译:弃用以获取详细信息。       注意:某些输入文件使用或覆盖已弃用的API。       注意:使用-Xlint重新编译:弃用以获取详细信息。       注意:/home/chaitanya/Videos/feb27/client/ionic/platforms/android/src/org/apache/cordova/file/AssetFilesystem.java   使用未经检查或不安全的操作。       注意:使用-Xlint重新编译:取消选中以获取详细信息。

失败:构建因异常而失败。

  • 出了什么问题: 任务':transformDexWithDexForRelease'执行失败。

      

    com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:com.android.dex.DexException:多个dex文件定义Lokhttp3 / Address ;

  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。

  • https://help.gradle.org

  • 获取更多帮助

在4s内建立失败

1 个答案:

答案 0 :(得分:0)

从Gradle 3.2开始,不推荐使用<<(leftShift)运算符。操作员可能会造成混乱,因为没有操作员,我们将配置deprecatedSample任务,而不是添加操作语句:println'Sample task'。

task deprecatedSample << {
    println 'Sample task'
}

为避免混淆,我们应该使用任务的doLast方法添加动作语句println'Sample task'。

task newSample {
    doLast {
        println 'Sample task'
    }
}