Android Studio compile error : enum constant INSTANT_RUN_REPLACEMENT does not exist in class

AndroidAndroid StudioGradle

Android Problem Overview


I'm getting following error in my project with Android Studio 2.0 preview 5 and gradle plugin 1.5.0. Even clean project throws the same error.

> EtaskArtifacts.bin .gradle/2.11/taskArtifacts/taskArtifacts.bin). > rror:Could not read entry ':app:processDebugManifest' from cache taskArtifacts.bin (/PROJECT_PATH/.gradle/2.10/taskArtifacts/taskArtifacts.bin).
> enum constant INSTANT_RUN_REPLACEMENT does not exist in class com.android.manifmerger.ManifestMerger2$Invoker$Feature

Android Solutions


Solution 1 - Android

Edit : The issue is already fixed, please upgrade to latest version of Android Studio, you can track the issue here.

I found a simple solution. Just delete ProjectDirectory/.gradle/taskArtifacts.bin file and restart Android Studio.

Solution 2 - Android

Here are the steps for fixing this

  1. Go to your Run/Debug configuration
  2. Select Edit Configuration....
  3. On General tab you might be getting red warning to Update Project.
  4. Click on it, it will handle handle rest.

enter image description here

Solution 3 - Android

Just go to your workbench directory. Navigate to your ProjectFolder and then delete the .gradle folder. Then rebuild your project!

Solution 4 - Android

Open terminal and run this line code to solve this problem:

rm .gradle/2.10/taskArtifacts/taskArtifacts.bin

Solution 5 - Android

This morning i had the same problem. The steps that worked for me are:

  • "Invalidate Cache and Restart" on Android Studio.
  • Click on "Run app"
  • Android Studio show you a dialog to update gradle

I hope this helps you

Solution 6 - Android

Open your_app/build.gradle file, and modify the compile dependecy in my case com.google.gms:google-services:2.0.0-alpha3 was changed by com.google.gms:google-services:2.0.0-alpha5

my_app/build.gradle not module my_app/app/build.gradle

Solution 7 - Android

Switching to gradle 2.0.0-alpha5 would probably fix that but in my case that causes build times of over 30 minutes and other significant issues.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionjimmy0251View Question on Stackoverflow
Solution 1 - Androidjimmy0251View Answer on Stackoverflow
Solution 2 - AndroidAbhishek PatidarView Answer on Stackoverflow
Solution 3 - AndroidJethroView Answer on Stackoverflow
Solution 4 - AndroidDaoLQView Answer on Stackoverflow
Solution 5 - Androidjam0ral3sView Answer on Stackoverflow
Solution 6 - AndroidJUAN CARLOS TLAXQUEÑOView Answer on Stackoverflow
Solution 7 - AndroiddraekkoView Answer on Stackoverflow