Error Gradle Build C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1

前端 未结 6 1179
太阳男子
太阳男子 2020-12-21 14:08

Error:Execution failed for task \':app:transformClassesWithDexForDebug\'. com.android.build.api.transform.TransformException: com.android.ide.common.process

相关标签:
6条回答
  • 2020-12-21 14:31

    I also faced the same issue after did reach i got resolved. issue could be the classes folder not created under build directory while you build the project, the reason for that the project path may not correct. so you have to correct the project path and rebuild that it will work fine. java files should be under path \src\main\java for gradle proejct

    0 讨论(0)
  • 2020-12-21 14:35

    I faced the same issue. Scrolling down, I found the following error in the logs:

    java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0

    Then I searched for the above error and found the following work-around as suggested by the solutions to this question and another similar question:

    In the file build.gradle(Module:app) I changed the following from:

    buildToolsVersion "24.0.0"

    to

    buildToolsVersion "23.0.2"

    and clicked the button to "sync project with gradle files" in Android Studio and the error vanished.

    Note: I didn't understand the exact reason for the error and it's solution completely but it seems to be a compatibility issue of java version 1.7 and Android API level 24. Some people suggested (on the questions' links I mentioned) to use JDK version 8 with API 24, or downgrade it to JDK version 7 and API level 23.0.x as a work around.

    0 讨论(0)
  • 2020-12-21 14:42

    Found cause and solution.

    All at the sudden this happened, when I created a class with the same signature (package and name) in 2 different projects of my environment and started the App to try it. Got that message.

    I discovered it by adding multiDexEnabled true and new error message appeared with duplicated class found.

    So, I refactored the class (changed package name), also removed multiDexEnabled support as it was before, the App started.

    0 讨论(0)
  • 2020-12-21 14:46

    I've got this error:

    Execution failed for task ':vvm:transformClassesWithDesugarForRelease'. com.android.build.api.transform.TransformException: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'E:\Java\jdk1.8.0_181\bin\java.exe''

    I've solved it by updating gradle from 4.4 to 5.4

    0 讨论(0)
  • 2020-12-21 14:49

    I also faced the same issue after did reach i not resolved. instead of applied two approaches as follows:

    Process 1: Update plugin with build.gradle

    plugins {
    id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
    }
    

    Process 2: Update the JAVA path while executing the application inside the IDE

    Still it is not working.

    0 讨论(0)
  • 2020-12-21 14:52

    In my case, I changed buildToolVersion in build.gradle(module:app) to 23.0.2 then the app is running.

    0 讨论(0)
提交回复
热议问题