androidandroid-instant-runinstant-run

Issue with Instant run when applicationId updated


I have updated my applicationId with a flavor by adding .fb

It was not needed so I removed the applicationIdSuffix ".fb"in the flavor. Since this update I'm not able to use instant run, I got an exception when trying to launch my app:

02-16 10:25:50.354 25526-25526/? I/InstantRun: Instant Run Runtime started. Android package is com.test.evilb.fb, real application class is com.test.evilb.application.MyApplication.
02-16 10:25:50.356 25526-25526/? E/InstantRun: Failed to create directory /data/data/com.test.evilb.fb/files/instant-run/dex
02-16 10:25:50.356 25526-25526/? E/InstantRun: Couldn't create dex code folder
02-16 10:25:50.357 25526-25532/? E/art: Failed sending reply to debugger: Broken pipe

It is still trying to install with the old aplicationId and throw this exception:

FATAL EXCEPTION: main
Process: com.onmo.soundchat, PID: 25526
java.lang.RuntimeException: Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.test.evilb.application.MyApplication

Even after Invalidate cache and restart, computer reboot, the issue still appears. If I disable the instant run I will run my app without trouble.

Is instant run has cache somewhere I can clean? Or do I need to do something to use instant run again?


Solution

  • Updating the buildToolsVersion did the trick for me. Posting my solution just in case someone get same issue