How to solve Instant Run on Android Studio Canary 5, 6 and 7

Since I upgraded to Android Studio Canary 5, I have had problems with Instant Run, it gives me the following error when activating Instant Run:

Information:Gradle tasks [:app:assembleDebug]
Error:C:\..etc.\app\build\intermediates\instant-run-support\debug\dependencies\AndroidManifest.xml:2 resource string/app_build_version_name (aka com.itbackyard.iels.client:string/app_build_version_name) not found
Error:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: Failed to execute aapt
Error:com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: Failed to execute aapt
Error:com.android.ide.common.process.ProcessException: Failed to execute aapt
Error:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Information:BUILD FAILED in 1m 29s
Information:8 errors
Information:0 warnings
Information:See complete output in console

      

My only solution was to disable Instant Run from settings. What I was able to find is a topic with no solution.

Any idea if this is still a bug or is there any work to do until it gets fixed?

Here is my version info:

Android Studio 3.0 Canary 5
Build #AI-171.4141229, built on June 28, 2017
JRE: 1.8.0_152-release-884-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

      


Edit I have now updated to

Android Studio 3.0 Canary 6
Build #AI-171.4163606, built on July 7, 2017
JRE: 1.8.0_152-release-884-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

      

And updated to Canary 7

Android Studio 3.0 Canary 7
Build #AI-171.4182969, built on July 14, 2017
JRE: 1.8.0_152-release-884-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

      

Still the same problem.

+3


source to share


2 answers


I solved it like this:

What I did was create an empty new project in Android Studio 3.0 Canary 7, it doesn't have this behavior. I compared the new empty default project to build.gradle (Module: app)

my existing project which has the mentioned problem.



Of course it may differ from case to case, but in my case I used a variable to update versionName

and it worked before without any problems, but not on Andriod Studio 3. So I fixed the line Sync

and the Rebuild

problem went away.

0


source


Add this gradle.properties file. it works for me

android.enableAapt2=false

      



Android Studio 3.0 Canary 5

If your build has failed due to a resource handling issue. To temporarily disable AAPT, set android.enableAapt2 = false in your gradle.properties file.

+1


source







All Articles