Keep facing Process unexpectedly exit in Android Studio 3.4.1

穿精又带淫゛_ 提交于 2020-07-03 01:37:16

问题


After an update of Java facing an issue of Process unexpectedly exit while creating the build for Android. I was using Android Studio 3.3.0 and updated it also into 3.4.1 also to see any update but there is no change. Currently I'm using

classpath 'com.android.tools.build:gradle:3.4.1'

could not run my app. When I try to run the error shows : Process unexpectedly exit.

I have tried with downgrading the version of gradle from 3.4.1 to 3.1.4 but it also din't work. And it gives a new error Process 'command 'C:\Program Files\Android\Android Studio\jre\bin\java.exe'' finished with non-zero exit value -1073741502

Thanks in advance.


回答1:


As per your problem, just try to delete .iml file of your existing project from the directory and then rebuild the project again. Hope it will work for you.




回答2:


Your studio seems to be messed up so you should try resetting it by going to c/users/documents and delete these three folders .android,.androidstudio3.4,.gradle after deleting restart your studio and see if this fixes it




回答3:


This error shows up because of latest version of AAPT library. Just add below code in your Project gradle file under allprojects section.

 configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
        config.resolutionStrategy.eachDependency { details ->
            details.useVersion("3.3.2-5309881")
        }
    }



回答4:


This problem of getting Process unexpectedly exit error usually occurs if you done a Android Studio upgrade or fresh install of android studio while without 'cleaning' traces of older versions of Android Studio. The reason could be that when you have multiple older versions of Android Studio residue files there is some conflict because of older version of .Android, .gradle, .cache and android sdk files/folders. I tried everything from clearing cashe, invalidating and restarting t downgrading gradle to different versions but nothing worked.

Next I decided to uninstall Android Studio 3.6.2 and do fresh install Android Studio 3.6.2 which is latest version as of 12th April 2020 () but that do did not remove the Process unexpectedly exit and even creating a new Hello World projectI would get the Process unexpectedly exit error .

in my 3rd try I again uninstalled Android Studio 3.6.2, then went to %userprofiles% and deleted the .Android, .gradle, .cache and delete android sdk folders. Reinstalled Android Studio 3.6.2 and the Process unexpectedly exit error was resolved. I have shared detailed steps so that you do not waste time in doing what I did for couple of days. Hope this is helpful.




回答5:


Downgrade the version of gradle from classpath 'com.android.tools.build:gradle:3.4.1' to

classpath 'com.android.tools.build:gradle:3.1.4' 


来源:https://stackoverflow.com/questions/56682944/keep-facing-process-unexpectedly-exit-in-android-studio-3-4-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!