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.
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.
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........
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")
}
}
downgrade the classpath from
'com.android.tools.build:gradle:3.4.1'
to
'com.android.tools.build:gradle:3.3.2'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With