Android studio build error with error log of "process unexpectedly exit" in ubuntu

34,233

Solution 1

This issue is because of latest version of AAPT library so please 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")
    }
}

Solution 2

It took alot of hours for me to found the solution. Just goto your build.gradle file change

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

after that install the SDK tools(if it's ask to install) After that Run your Project.. Happy coding........

Solution 3

Same for me. I also have ho solution but workaround. In project-level build.gradle downgrade gradle version from

classpath 'com.android.tools.build:gradle:3.2.x'

to

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

In my case it makes project build. Wish someone tells a right solution.

Solution 4

downgrade the classpath from

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

to

'com.android.tools.build:gradle:3.3.2'

Solution 5

There are two solutions which i successfully applied. one is you can downgrade the gradle to

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

Second one is put this below code in app module gradle

  configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
  config.resolutionStrategy.eachDependency { details ->
    details.useVersion("3.3.2-5309881")
    }
  }
Share:
34,233
Daredevil
Author by

Daredevil

Updated on July 05, 2022

Comments

  • Daredevil
    Daredevil almost 2 years

    I have installed android studio in ubuntu and whenever i try to create a new project the build is failing with an error saying process unexpectedly exit I am using ubuntu 16.02 LTS version and android studio 3.2.1 version.

    This is my build log.

    org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:mergeDebugResources 
    Caused by: org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.2.1-4818971-linux Daemon #1: Daemon startup failed
    This should not happen under normal circumstances, please file an issue if it does
    Caused by: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.2.1-4818971-linux Daemon #1: Daemon startup failed
    Caused by: com.android.builder.internal.aapt.v2.Aapt2InternalException: Failed to start AAPT2 process.
    Caused by: java.io.IOException: Process unexpectedly exit.
    at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.startProcess(Aapt2DaemonImpl.kt:110)
    ... 9 more
    

    I tried to find any help online regarding this but couldn't get any useful ones yet. If this is a normal thing to happen, i am sorry for asking this. I'm a noob to linux as well as to android studio.Thanks in advance for any help.

  • Daredevil
    Daredevil over 5 years
    I have the same issues no matter how much times i tried doing everything from the beginning. Tried changing the installation folders too. But this same error keeps coming up. I really wish to find if there is a solution.
  • varun
    varun about 5 years
    Hey, further, I understand that the Android Studio version and the gradle plugin version in the project's build.gradle should match, but this workaround requires otherwise!
  • Shiva Acharjee
    Shiva Acharjee over 4 years
    Yes, this solved. I remember it all started after I have updated the android gradle plugin.
  • chandan kumar
    chandan kumar over 4 years
    getting Could not resolve all files for configuration ':app:_internal_aapt2_binary' error