Currently I’m using Android Studio 2.0 and installing my APK into my Samsung device (S6). However, when rebuilding my code and running it again I receive the following error:
Error installing cold swap patches: com.android.tools.fd.client.InstantRunPushFailedException: Error creating folder with: run-as com.appcustomer mkdir -p /data/data/com.appcustomer/files/instant-run/inbox Error while Installing restart patches
Does anyone have any idea what this issue is?
I think the issue is due to instant run feature of Android Studio 2.0. This might help
- Open the Settings or Preferences dialog.
- Navigate to Build, Execution, Deployment > Instant Run.
- Uncheck the box next to Restart activity on code changes
I am having the same issue. My “fix” was to uninstall the app each time before installing it through Android Studio.
What I think is that if your app is running already, Android Studio is unable to rewrite the “updated” build on top of that. So, either you manually stop the app or add this to Gradle to fix the issue.
I know it’s just a workaround and I’d love to get a legitimate fix for this.
Me to having the same issue and u can resolve it by uninstalling the app before running the app from android studio
This started happening on my Samsung Tab A as soon as I installed the Marshmallow upgrade. This was painful because Android Studio had to perform a slow recompile of the entire app for every minor code change. Worse, Instrumentation no longer worked, e.g. an NPE would crash the app without showing any messages in the debug window.
The problems went away when when I reverted back to Lollipop.
Despite what Samsung support told me, I am able to block the annoying Marshmallow upgrade popups by disabling Software update (com.wssyncmldm and com.sec.android.fotaclient).
According to Google “this is a bug on the android software installed on these phones” https://code.google.com/p/android/issues/detail?id=200881. The next device I purchase for app development will not be a Samsung.
Restarting Android Studio worked for me.
I think the error happens when you disconnect the device when it is running your app from Android Studio.
Clean the project and in File option of Android Studio press Invalidate Caches/ Restart. Disable Instant Run and do a gradle sync. This worked for me. I am using Mac, I think this will be similar in Windows and Ubuntu.
I updated Android Studio to 2.2.3 and Gradle to 2.14.1 and it worked.
This is session related issue. Restart studio and avoid pulling cable during instant run for future repeat of this problem.
I found this solution that works for me (AndroidStudio 2.1.3, Android 6.0.1).
With the Android app running, without closing it on the connected device (smartphone/tablet), do the following steps:
- Re-launch the Android app on AndroidStudio, with “Run” button (through the green right arrow);
- After 1 sec, press on “Stop” button (through the red square);
- AndroidStudio shows two different running processes: the already running Android app on on the connected device, and the Gradle compiling process;
- Stop the first one (the already running Android app on the connected device), and leave the Gradle process to complete the deployment of the new version of the Android app on the connected device.
For me this solution works.
Another solution can be by selecting the Run button, the app on the device crashes, since it tries to reopen with an instance of itself already running, and then by selecting another time the Run button.
In this way the patches that need to be applied to the app will be compiled and the app restart with its new version.