Error while Installing restart patches when launching android app with Android Studio 2.0

浪尽此生 提交于 2019-11-29 10:39:03

问题


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?


回答1:


I think the issue is due to instant run feature of Android Studio 2.0. This might help

  1. Open the Settings or Preferences dialog.
  2. Navigate to Build, Execution, Deployment > Instant Run.
  3. Uncheck the box next to Restart activity on code changes



回答2:


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.




回答3:


Me to having the same issue and u can resolve it by uninstalling the app before running the app from android studio




回答4:


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.




回答5:


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.




回答6:


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.




回答7:


I updated Android Studio to 2.2.3 and Gradle to 2.14.1 and it worked.




回答8:


This is session related issue. Restart studio and avoid pulling cable during instant run for future repeat of this problem.




回答9:


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:

  1. Re-launch the Android app on AndroidStudio, with "Run" button (through the green right arrow);
  2. After 1 sec, press on "Stop" button (through the red square);
  3. AndroidStudio shows two different running processes: the already running Android app on on the connected device, and the Gradle compiling process;
  4. 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.




回答10:


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.



来源:https://stackoverflow.com/questions/36680036/error-while-installing-restart-patches-when-launching-android-app-with-android-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!