When I hit run, Android Studio installs the app on my device (not emulator), but sometimes the code does not change (e.g. some Logs still output to the console whilw they actually got removed).
I faced a similar problem before: When I tried to install the app, Android Studio said there were no changes made, so it canceled the process. I could solve this problem by unchecking "Skip installation if APK has not changed" in "Installation Options". (I disabled "Instant Run" as well).
Since Android Studio now returns "Success" when I run the app, I thought the problem was my device, so I restarted it, but nothing changed. Then I cleaned the caches of Android Studio, restarted AS, installed the app and it worked...
Because I don't want to clean my cache and restart Android Studio every hour, I look for a solution on this problem. Any suggestions?
This happens occasionally for me, and the best solution I've found is uninstalling the app from my phone and reinstalling it. To uninstall the app, hold down on the icon in the app list menu and drag it to the uninstall field. It should always reinstall with the updated code.
Related
i'm trying to install my app debug from my android studio. it's work well yesterday, but today when i try to install it again, the application cant be installed on my device and showing error like below on my android studio.
Installation did not succeed.
The application could not be installed: SHELL_UNRESPONSIVE
The device timed out while trying to install the application.
Retry
what should i do? i tried install on other device, and it worked fine. My device is Redmi 4X and other device is Samsung J3
Faced the same issue, not sure of the reason but in Android studio, Click on the File -> Invalidate Caches/ Restart and then it starts to work.
I got same issue with my device. i restart my device and its work properly.
The problem is because you don't have the proper SDK for the Android version. I'm telling you because a month has passed for me too. The solution is to download the appropriate pack in the SDK Manager.
If you have doubts how to enter:
Close the project.
In the welcome panel click on settings, then choose the SDK Manager option.
Click show package details and select the version for Android and choose all packages.
Finally you click ok XD
Try this method if it works perfect greetings
If other answers didn't help and previously application was installing correctly on your device, try to check your AndroidManifest file. Check that nothing forbids to install your app because of os version conflict or manifest merging errors or other reasons.
I came across this problem recently, through process of elimination I determined the cause was related to dependencies in the build.gradle(your app name).
I suggest working backwards and comment out everything that was added since the last known working build/install.
In my case I have a legacy app developed back in 2016 being rewritten, dependencies for signalR have changed quite a bit since then, the original libs where causing the install to fail while everything else seemed excellent, not even a single build error was occurring. Commenting out the libs and references got the application to a runnable state.
In my case, I deleted the emulator and recreated it. It solved the issue.
Before this, I had already tried following which did not work for me:
From menu: File->Invalidate cache/restart.
Deleting .cxx, .idea, .gradle, build folders and rebuilding.
Cold boot device emulator
Posting this in case someone is trapped in my kind of situation.
So far I have used instant run without any problem in a Nexus 5 with android 7.
Yesterday I updated Android Studio to stable version 3.3
Since then, Instant Run does not work, I always get the following warning:
Selecting the option to uninstall the previous version, it does not start, because the warning of "error installing the APK"
If I deactivate instant Run everything works perfectly again.
About the code or configuration, nothing has been changed.
Of course, I also manually uninstalled the previous version before the initial compilation.
I have read about it in this forum, but I can not find a solution to this specific problem case.
It happens to someone else? Any solution?
I keep getting the same message each time I try to download my app to my tablet. I have gone to my tablet and deleted every app that I have ever built but still get the same error?
Installation failed with message Invalid File:
/home/gary/AndroidStudioProjects/wifi-direct-demo-master1/app/build/intermediates/split-apk/debug/slices/slice_2.apk.
It is possible that this issue is resolved by uninstalling an existing version
of the apk if it is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
I was working on my laptop and have since switched to a company supplied computer, so the /home/gary is my laptop and /home/jpogge is the company computer.
You might have the app still installed for other users. You can't see them among your apps but if you go to Settings/Apps/All, they are at the bottom listed as 'Not installed'. Remove them for all users.
Alternatively, I've also found that a clean build solves the problem; clean project -> rebuild from build menu.
I have a problem with installing my application to my phone for second time, I set USB debugging and stay awake in the developer setting. For the first time I install and use my app correctly but after I uninstall it by phone and reinstall again by android studio this error has occurred:
I was getting this in Android Studio and all I did to fix it was go to "Build" > "Clean Project" and it just worked.
Its due to your device is not able to uninstall the application properly, try to reboot once it may solve your issue. Also try to clean and rebuild your project.
Just uninstall the app from device. Then rebuild and install
Go to the apps option in settings in your phone and see if the application is still listed there . Search the entire list, it could be on the bottom of the list. Remove from there and then you could install the app from studio.
I have a big project in Android Studio, that recently started doing this problem when I try to debug it. I clean the project, rebuild it, no errors at all, then I debug it, and on the phone in stands forever on
Waiting for Debugger
This happens only on the project I am working on, if I make a new project and try to debug it, it runs without a problem, but on the previous one, it always hangs there and never finishes.
Also, if I try to run the project normally, it's ok, it runs, and then I open Tools -> Android -> Android Device Monitor, and from there the option to attach a debugger to the process is grey, I can't click it. Why is that? Could it be related to the main problem I am having?
EDIT: Restarting Studo, PC or device not helping
EDIT 2: Deleting the .gradle and .AndroidStudioXXX folders in user folder in Documents seems to have fixed the issue, but it also completely resetted Android Studio, so this is not a proper solution.
Once Invalidate Caches / restart your project. Keep that app is not available in your device.