Free $25 credit. Click Here!

Android Studio 4.0 and window 8.1 “Process Unexpectedly exit” and how to fix it?

Android Studio 4.0 and window 8.1 “Process Unexpectedly exit” and how to fix it?

Android Studio 4.0 Fresh install

Few days back, when i was working on my Android Studio. I received the notification about the new update for Android Studio. So, i proceeded after doing all the update i imported settings from the Android Studio 3.1.4 to Android Studio 4.0 along with the project on which i was already working.

Build was successful but when i tried to run the app on my physical device or build the .apk it gave me “process unexpectedly exit”.

Android Studio error process unexpectedly exit - Blogcani

Before i come to the solution let us first understand what is this issue exactly is?

This issue is caused by dependency on the aapt2 library. Though i am not sure exactly why this issue occurred, whether this issue is caused by android studio running on window 8.1 or something else. But i was running the old android studio without any difficulty on my window 8.1 pc before. So, it can’t be the issue with the window 8.1 but anyways let me explain to you how i was able to fix this issue which resulted me headaches.

From here on i started searching for the solutions. Before coming to the final working solution what i tried :

1) Uninstalled the old Android Studio

2) Deleted .gradle, .android etc. directories from c:\<your-user-directory>\

3) Installed fresh Android Studio 4.0 2-3 times and restarted pc.

4) Installed window universal c runtime.

5) Downgrade android build tool version in build.gradle (project) file to lower version like classpath ‘’ to
classpath ‘’

6) Clean project and rebuild.

7) Tried connecting other mobile device to test whether it can help me to run the app.

8) Updated the android IDE and plugin (But let me tell you this shouldn’t be done unless it is very important or required to run your app. As this will result in installing the android studio from fresh again and again.)

9) Upgraded the gradle version in : distributionUrl=https\://Ā to distributionUrl=https\:// .

10) Saw number of videos on youtube.

And lots of other things that i was able to find on google but nothing worked. This all happen over 2 – 3 days time period. So, you can say that i gave my 100% to solve this issue. After doing all this hard work. I finally found the solution and it was adding this code under allprojects in build.gradle

configurations.matching { == ‘_internal_aapt2_binary’ }.all { config ->
config.resolutionStrategy.eachDependency { details ->

and it did wonders. I did clean the project after that and rebuild it. After successful build i run the app on my physical device and was able to generate .apk as well. But you can try all these solutions as in combination. If the solution that i gave you not worked.

I explained this in detail here because i didn’t find enough good explanation for the issue. So, anyone having similar type of issue in android studio, can try this code. It will surely work.

If you did tried this solution and still having issues let me know i can help you to fix it or if you have any other way to fix this issue you can share with me. In order to contact me click here

Will come back to you with some more coding stuff till then. Happy Coding!