why java.exe exit with value 1 in android studio

后端 未结 10 1169
有刺的猬
有刺的猬 2020-12-04 01:22

Error:Execution failed for task \':app:dexDebug\'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process

10条回答
  •  猫巷女王i
    2020-12-04 02:04

    Found 2 resolutions.

    I. First one is simple. Open AS error log file (generated in project directory) and if it contains information that there is not enough memory for Java to do it's job - simply close unnecessary applications to free memory and run again.

    II. Another one is due to corrupted project files (for some reason): Do project clean up and then import again in Android Studio (AS). That's how to do it in details.

    1. File -> Close project (if it is opened in AS)
    2. Open project directory, search for *.iml files and remove all of them
    3. Remove all generated by AS and build process directories: .gradle .idea build
    4. After that open AS and import project again. Now, wait, wait, wait and you should now be able to run again.

    Note: that you'll end up without all project specific AS settings.

    That's simply the thing, which I do from time to time when upgrading to latest AS. That is one of the reasons I never commit those AS-related files to VCS (and teammates allways do import in AS after fresh check out from VCS)

提交回复
热议问题