How to disable Instant Run for Android Studio 3.0 - android

After making a few changes I am getting an error
Session 'app': Error Installing APKs
According to some it is because of Instant Run.
On the latest Stable Android Studio 3.0, under Build, Execution, Deployment I don't have any option for Instant Run, even checked in the settings search. Any clue where I might be able to disable it?
Update 1: Tried reinstalling. No change.
Build number 171.4408382
Update 2: Gave reset a shot https://stackoverflow.com/a/19397632/1926621 still nothing.
Update 3: Not a duplicate. Must be something in the settings. A complete clean install/reset did it.
Screenshot of what I see:

Go to Android Studio Settings or Preferences (for MAC) -> Build,Execution,Deployment -> Instant Run.
Then deselect the "Enable Instant Run" checkbox at the top.
Linux Screenshot:
Windows Screenshot:
For Mac go to Help in MenuBar and type 'preferences'
or,
go to 'Android Studio -> Preferences' in MenuBar
Mac ScreenShot

Instant Run is not a feature of Android Studio 3.5 (and later) any more and so cannot be disabled.
In case you find an old guide recommending to disable it, you can ignore this instruction.
See here 1 and here 2.

Just make sure you go to Android Studio -> Preferences instead of File -> Other settings -> default settings.
Instant run should be there.

Instant Run is removed from Android Studio 3.5 and added Apply Changes which works for Android 8 and above please follow the link for more https://android-developers.googleblog.com/2019/08/android-studio-35-project-marble-goes.html

Finally fixed!
As other users on Linux and such saw the Instant Run option in the settings, I tried reinstalling and resetting the installation, following https://stackoverflow.com/a/19397632/1926621
Removed all old settings, and installation of Android Studio( kept the SDK files). Changed the path. Opened the same project, and the options were now there!

Easiest/Laziest option for For mac would be CMD+SHIFT+A Search for instant run, click on relevant suggestion and uncheck the checkbox

Instant run is not a feature in Android Studio Bumblebee anymore.

Related

Xamarin.Forms: deployment issue after Visual Studio upgrade

After upgrading Visual Studio Professional 2019 to version 16.9.2, when I try to deploy on Android Emulator
api 28 (9.0), I get following error:
Error XA0130: Sorry. Fast deployment is only supported on devices running Android 5.0 (API level 21) or higher. Please disable fast deployment in the Visual Studio project property pages or edit the project file in a text editor and set the 'EmbedAssembliesIntoApk' MSBuild property to 'true'.
Before the upgrade, everything worked fine. This is really frustating!
To correct this problem I had to
uninstall app on Android phone (important step)
Unload Android Project from solution explorer
This brings up the project file code now search code for
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
Change false to true save
reload project problem solved.
Note leave fast deploy checked.
Go to >> Solution Properties>> Android Options>> Uncheck "Use Fast Deployment(debug mode only)"
I had the same issue recently after adding images to my project found out that I had upper case letters as a name SomePicture.png renaming all images to lower case solved it.
#AlwinBrabu, I think you meant "Project Properties" -> Android Options -> Uncheck Fast Deployment(debug mode only).
This worked for me, although this is a workaround. I do not consider it a solution.
To solve this, I had to right-click on the Android project in the Solution Explorer, then in Options -> Android Build uncheck the Fast Assembly Deployment option.
Then deploy the project on the Android emulator.
But after deploying it once, I went back to the settings and checked (i.e. ticked) the Fast Assembly Deployment option, and subsequent deploys worked fine.
I'm running Visual Studio for Mac 2022 version 17.0.1 (build 72).

How can I solve "Error:Could not download gradle-core.jar (com.android.tools.build:gradle-core:2.2.3): No cached version available for offline mode"

Error:Could not download gradle-core.jar
(com.android.tools.build:gradle-core:2.2.3): No cached version
available for offline mode
I am using Android Studio 2.3. This error appears after new update.
You can disable offline work in the gradle settings.
Open you android studio path, then open path:
/gradle/m2repository/com/android/tools/build/gradle-core/
Then, gradle-core-2.2.3.jar should appear, like this:
/gradle/m2repository/com/android/tools/build/gradle-core/2.2.3/gradle-core-2.2.3.jar.
If not, you will have to download it and put it at there.
Happened to me too. Here's what I did:
1 - Go to Settings -> Build, Execution, Deployment option -> Instant Run
2 - Uncheck Enable instant run to hot swap code
3 - Clean project
4 - Check Enable instant run to hot swap code and build again.
Worked for me, hope it is a fix for everyone facing the same issue.

Android Studio: Application Installation Failed

I've been trying to learn how to use Android Studio but when I attempted to run one of the sample programs I get this error message:
Installation failed with message null.
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've tried to do this on 5 more sample programs and all of them give me this error. Does anyone know how to solve this?
I'm Using Redmi 3s mobile. I got same problem.
Solution: This issue is common on Xiaomi phones running MIUI 8. This can resolved by turning off MIUI optimizations from Developer Options in Settings app. Then recompile the app and voila it works.
Settings --> Additional settings --> Developer options --> Turn Off MIUI optimization
Or
Settings --> Developer options --> Turn Off MIUI optimization
I got the same problem , just choose clean project then rebuild project from build menu , it's solved my problem
Disable Instant Run
Preferences > Build, Execution, Deployment > Instant Run
Source: comment by #user77309
Path: Android Studio Preference / Build, Execution, Deployment / Instant Run
Go to Android Studio Preference (for Mac) or Settings (for windows)
Choose Build, Execution, Deployment tab
Choose Instant Run
Uncheck Enable Instant Run to hot swap code/resources changes on deply (default enabled)
It works for me!!
Go to Settings > Applications. Probably you have the app still installed for other users (I had the same problem with a Moto G, I did not see the app among other apps, but it still was among my apps in Settings). Try to find it and remove for all users.
If the problem is this one you will find the app at the end of the list (in Settings > Apps > All)
All the apps marked as "Not installed" are still there and you can not install the same apps with Android Studio until they are there
This happens when your app is using any library and there is also an app installed in your device that is using the same library.
Go to gradle and type:
android{
defaultConfig.applicationId="your package"
}
this will resolve your problem.
INSUFFICIENT_STORAGE
Solution:clean you phone storage
Pay attention Android Studio log:
open: Permission denied
open: Permission denied
pkg: /data/local/tmp/com.example......... Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
Step 1: Go to "Setting" → find "Developer options" in System, and click.
Step 2: TURN ON "Verify apps over USB" in Debugging section.
Step 3: Try "Run app" in Android Studio again!
and you should also TURN ON following fields inside "Developer option" .....
1: TURN ON ->"Install via USB" field
Some solutions:
1 Build -> Clean Project
2 Build -> Rebuild Project
3 Built -> Make Project
4 Remove your application from device and try install again
5 Mb you have some problems with actual version of yours app(try to pull actual branch). Also you can check on your emmulator, if yours app is running.
6 Try to use 1,2,3,4 solutions.
The solution for me was : (in a Huawei)
Android Studio -> Build -> Clean Project
In the phone -> go to Phone Manager -> Cleanup and Optimize
I had the same issue, and found that it was the USB cable I was using that was causing the issue.
Changing the USB cable fixed the issue, and I could successfully install the app afterwards.
In real device do below tasks..
1.clean all cache memory.
2.check the internal storage space (if space is just 500 mb free, then remove some data or app in the internal storage maintain at least 1 gb space.
3.again do clean all cache memory.
4.now goto android studio or eclipse click on app goto run select the device and run
I hope app will install and it will run..!!!
Uninstalling from AVD worked for me. After reinstalling it worked
For the 1st time installation of apps in a device, enable developer option which is mentioned in the above post. For facing problem while installing the apps from the tool, follow the below steps....
By enabling an option in settings, you can install apps directly. Error will disappear.
For MI users: Go to Settings-> Additional settings-> Privacy-> Unknown sources (make it enable)
For Normal Users: Go to Settings-> Security -> Unknown sources (make it enable)
Simply closing Android Studio (and emulator) then re-opening fixed it for me. Once I ran the app again, the apk re-installed successfully and app ran properly.
Recently I also find the same problem and there some reasons behind this but I am giving you 3
In your phone in the setting go to "Developer Option" and enable USB debugging
Also, check the "Install via USB" is also on in Developer Option itself.
In Android Studio go to File -> Settings -> Build, Execution, Deployment -> Instant Run and uncheck the Enable Instant Run
It must work.
Happened to me as well:
At the first time, it says-
Failure [INSTALL_FAILED_CONFLICTING_PROVIDER]
At the second time, it says-
DELETE_FAILED_INTERNAL_ERROR
This because of the new 'com.google.android.gms' version 8.3.0
Changing it back to 8.1.0 solved the problem in my case
I was having the same error, but i fixed it after reinstalling the HAXM. This problem is caused because of the virtual device not starting properly. If your device keep showing on screen "Android" or the screen is black, it have not started yet, you have to wait more for it to start properly, then it shall run. If it is too slow, maybe you should find a way to accelerate the Android Virtual Device (AVD). The Intel computers have the HAXM (hardware-accelerated-execution-manager).
In my computer was not starting because of the HAXM not working, I fixed it by reinstalling the HAXM, downloading it from the intel website: "https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager"
Then i set the HAXM max memory to 1536MB in the installation, for not having the problem of this other post, that you maybe have and i was having too: "HAXM configuration in android studio"
After all done, it worked fine.
android {
buildTypes {
debug {
debuggable true
}
and
In the AndroidManifest.xml file, add android:debuggable="true" to the <application> element.
https://developer.android.com/studio/run/device.html#setting-up
it works for me..
I solved the issue by simply deleting my whole /build folder and rebuilding (menu Build > rebuild project).
This problem cause to me because of the project path .
Y:\Example&SourceCode with & sign
So i change the Project path to another one without special characters. Now It is Fine.
For me it only started working after I rebooted device (Motorola-Nexus-6).
(I also tried to clean, disable "instant run", reopen Android Studio, verified installed applications to be sure there are no clashes, disable and reenable Debug mode in phone, reconnect USB cable)
I have faced this issue since I have upgraded the build tools from 26.0.2 to 27.0.3. Reverting back, clean and rebuild solve the issue.
Also I have degraded the gradle plugin version from 3.1.3 to 3.0.1 as the latest version was overriding the build tools to latest version.
I also got same problem while generating signed APK. Just select APK signature scheme v1, not v2 (introduced in in Android 7.0). If you select v2 scheme it won't work on devices that use Android versions older than 7.0.
if your "versionCode" in build.gradle file is less than the eralier version code then, your app wont install.
Try to install with same "version code" or more than that.
If you do all of things above and still get stuck, just try reopening your Android Studio.
I had the same issue but finally it worked after storage clean on my mobile. May be happen because of insufficient storage
I have a Redmi K20, the following is MI, Redmi specific that I learned in a hard way
How I ended up in the error: I uninstalled the debug app from the phone because my assets were not accessible (maybe I had faulty source code)
Solution (steps that worked for me in sequence):
Uninstall the app
As per suggestion above by #Jayaprakash G and all, I turned off MIUI optimization
I tried finding "Instant Run", but seems missing in Android Studio 3.6.2
MI supports "Second Space", switch to it. You'll observe the app is still there. Again uninstall.
Switch space back to original again. By any chance, if you see the same app in frequently used app in the app drawer, again uninstall.
Try to compile and run the app from Android Studio and let it show in the app phone (Error 3 will be still there, but installation will succeed).
Clean the project, close Android Studio
Start Android Studio, now everything will work as normal without the Error 3
I solve this problem by:
Enable Instant Run
Settings>Build, Execution, Deployment>Instant Run

Visual studio can't debug Android Xamarin app

I've started with Xamarin and Android using Visual Studio 2013.
When I start debugging the android app, it builds, deploys to device and then debugging in Visual Studio stops. I can't hit any breakpoint. App is working in device, but I cannot debug it.
Am I missing something?
I've tried various emulators and a physical android device but debugging doesn't work in any of them. It just act like I have stopped it.
Debugging the same solution in Xamarin Studio works, I just can't get it working in Visual Studio.
I was having the same problem and I found this workaround with Hyper-V in Xamarin's documentation: https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-emulator/visual-studio-android-emulator/
TL;DR; Open Hyper-V Manager -> Go to settings on your emulator -> Go to processor settings -> Select Compatibility -> Mark the "Migrate to a physical computer with a different processor version" checkbox -> Done! (At least for me) VS is now debugging my Android App
Another reason why Visual studio can't debug Android Xamarin app with a Hyper-V is due to you don´t have 'Deploy" option check in android project.
Steps: 1) Enter in "Solution properties" 2) Select "Configurarion Properties" 3) Check "Deploy" in Android project.
Make sure you are running on Debug mode (on target).
Then, check the Properties of the App Project and see if it's using the Xamarin debugger instead of the VisualStudio Debugger.
Enter in "Solution properties"
Select "Configurarion Properties"
Check "Deploy" in Android project.
Open Hyper-V Manager
Go to settings on your emulator
Go to processor settings
Select Compatibility
Mark the "Migrate to a physical computer with a different processor version" checkbox
This will also happen if you don't have any activity marked as your main launcher activity:
[Activity(
...
MainLauncher = true,
...)]
public class MainActivity ...
Easy mistake to make if you're shifting code in from a prior project and the prior project is using a splash activity and your new project is not yet doing so.
Go to property of app project then click android option and checked checkbox in debugging section.then run again.
For anyone who might still need help. Also make sure the build and deploy checkbox's are checked in the configuration manager. .
In my case, after some investigation, I saw I was having this warning: "Failed to read .android.dll' with debugging symbols. Retrying to load it without it. Error details are logged below. 2>Mono.Cecil.Cil.SymbolsNotMatchingException: symbols were found but are not mathing the assembly"
The solution was to disable linking:
Right-click the Android Project -> Properties -> Android Options -> Under "Linker properties", set Linking to None (see image below)
Got this from TedFalasco's answer on this post.
Hyper-V manager can't be installed on Windows 7 (only the management tool gets installed) so if you get this problem, following those steps don't help.
Here is the thing that worked for me and it's mentioned here as an answer but hasn't been marked up or marked as an answer. This is actually the best and easiest solution. nothing else worked for me.
In Visual studio, make sure you choose the solution file (not project files) in the solution explorer. Then go "Project > [project]properties"
in the left pane choose "Configuration Properties > Configuration"
Now check the Deploy feature if possible. Only deployable projects have the option.
This saved my life and I almost gave up on Xamarin. I really hope this helps others like me.....
In my case, the warning was self-explanatory:
Set the debugging information to Portable in the Visual Studio project property pages or edit the project file in a text editor and set the 'DebugType' MSBuild property to 'portable' to use the newer
In other words: Right click on project => properties => build => click on advanced => set the debugging information to portable.
I have tried every answer and none of them worked.
Here is what I did to make it work again:
Plug your physical android device to the computer. Android device must have Developer options enabled.
Choose your android device in Visual Studio.
Run app in Debug mode. Your app should appear on your android device.
Unplug your android device from computer.
Try running your app in android emulator. For me Debug option starts working again.

Problems found loading Plugins in Android Studio

After updating Gradle as suggested in this answer the following error appears while using Android Studio 0.2.0
How to get over this one?
go to Settings-Plugins-IDE Settings and just disable and enable again needed plugins - it helped me.
I think it was some bug on Studio
I have the same error, and I solve it as mentioned above:
go as flow file-->settings-->plugins
then uncheck the red options
apply settings You will get error message no problem
recheck the unchecked options
press ok
it will request to restart android studio press ok button and it will solve the error and work fine again
1.Go to settings -> uncheck all red check one's -> apply
2.It will restart your android studio -> OK
3.Go to settings -> Plugins -> check the unchecked one's->apply
4.Restart and update them all.
//done
//thankyou
I try to remove and reinstall Extras or disable and enable plugins but the problem is not solved.
I find a solution to correct that is to reset Android Studio You have to remove this directory and restart Android Studio to detect the SDK location:
~/Library/Preferences/AndroidStudio*
~/Library/Caches/AndroidStudio*
~/Library/Logs/AndroidStudio*
As you see, image uploaded by you, Configure, go to that menu. Now click on Settings. Try to find Plugins in IDE Settings. Here look out for Gradle and check whether it is installed or not.
If not, Click on Install JetBrains Plugin... or Browse Categories and find Gradle. Now on top, besides Refresh button there is a Download and Install button. Using that button install Gradle Plugin.
Andorid studio -> preferences > plugins, enable "support" plugin. And then if there are red plugin, disabled it and restart android studio
Go to File->Settings-> Plugins then uncheck then check all the red highlighted plugin then restart the android studio if require
I solved it this way..
Go to file then settings (Ctrl+alt+S) > then go to plugins > on the "show" dropdown button select disabled > unchecke the check-buttons then they'll disappear> again select disabled then check them and press OK. On request to restart android studio, restart it and it'll be working fine
For Mac, this worked
Menu > Preferences > Plugins
Uncheck all
Android studio will ask to restart, restart it
Check all again
Restart Again
And Voila!
Unchecking the gradle plugin and checking it again then restarting android studio and selecting the SDK location and downloading the missing dependencies worked for me
I solved this problem with reset android studio settings.
On Windows:
Go to your User Folder - on Windows 7/8 this would be:
[SYSDRIVE]:\Users[your username] (ex. C:\Users\JohnDoe)
In this folder there should be a folder called .AndroidStudioBeta or .AndroidStudio (notice the period at the start - so on some OSes it would be hidden).
Delete this folder (or better yet, move it to a backup location - so you can return it if something goes wrong).
This should reset your Android Studio settings to default.
https://stackoverflow.com/a/19397632/793880
2020/12/10 - Ubuntu 18.04 and Android Studio 4.2
I solved it this way:
Using strace I've found the user installed plugins directory on "/home//.local/share/Google/AndroidStudioPreview4.2" (not documented in any place i've read, nor official doc, nor IntelijIdea either)
Just deleted the directories of the failing plugins (that are not listed with installed plugins, so can't uncheck anything), and problem fixed.

Categories

Resources