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

Daredevil picture Daredevil · Oct 13, 2018 · Viewed 32.7k times · Source

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.

Answer

Dmitry I. Sokolov picture Dmitry I. Sokolov · Oct 16, 2018

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.