I'm getting this error in Gradle in Android Studio:
:cart:transformClassesWithInstantRunForDebug FAILED
Error:Execution failed for task :cart:transformClassesWithInstantRunForDebug'.>
java.lang.ClassNotFoundException: com.google.gsonhtcfix.JsonSyntaxException`
I am not able to run/execute my project in Android Studio. How can I resolve this issue?
Something you can try is deleting the build folder. That does not always work but fixes it sometimes.
rm -rf cart/build
If that does not work. Run that command then in Android Studio select invalidate caches and restart.
This problem happen when the used gradle
have problem with instant run.
So to solve this you have to either change gradle
version or disable instant run.
In my nexus 5 I have get only warrning, but another devices not complied, so I have disabled debug mode if i need it /
buildTypes {
release {
debuggable false
minifyEnabled true
proguardFiles 'proguard-android.txt', 'proguard-rules.pro'
}
debug {
debuggable false
minifyEnabled false
proguardFiles 'proguard-android.txt', 'proguard-rules.pro'
}
}
来源:https://stackoverflow.com/questions/34059352/android-studio-2-0-preview-apptransformclasseswithinstantrunfordebug-failed