Error while Installing APK Android Studio 3.3 - android

I am unable to run application on any android phone. I have Android Studio 3.3 , and it used to work fine. And now suddnely it shows Error while Installing APK . Session 'app': Error Installing APK
I tried :
-- Clean, Build ,
-- Invalidate caches and Restart ,
-- Disabled Instant Run ,
-- Checked devices for storage , USB debugging
Nothing works. I cannot install the apk on android device.
Any one knows how to resolve this issue? Any help is appreciated.
Thanks.

I've faced this issue before, & turns out the device just had insufficient memory for the app.
Try free up some memory on your device.

This question seems too broad to give an appropriately specific answer. I can give some recommendations that you might have not done yet.
Remove app from device and install it again.
Maybe you have not allowed USB debugging in developer options.
Maybe you have not allowed USB debugging on this phone. The dialog that appears whenever you connect the phone to the pc.
Also, I would suggest adding a screenshot of the error

Related

Android studio - not able to install apk

I am trying to install apk from android studio. Initially I got below error:
So I disable instant run as suggested in many post on stackoverflow like this How To Stop Installation of Multiple Slice APK In Android Studio 2.3.
Now I am getting below error after disabling instant run:
java.io.IOException: An established connection was aborted by the
software in your host machine Error while Installing APK
I have only one instance of android studio running when I got this error.
Android studio version is 3.3.1. What can be cause of above error.
Also I am not able to install apk using adb install command. I am getting message failed to install apk with no detail message.
You can restart Android Studio : File -> Invalidate caches/restart
And i think you install ADB-Idea pluggin to uninstall or clear app data very easy with shortcut.
ADB-Idea pluggin :
Link
So I found out why I was not able to install apk from studio or from adb install command. Issue was due to my pc usb port was blocked by network administrator of our organization as my usb port usage period expired. So if anyone facing issue of not able to install apk and getting error as mentioned in question and no solution working for you than please check if your pc ports are not blocked by your organization network admin. I took approval to use usb port and it is working now.
You have got the first error because of :
You are testing your project_A on a emulator_E
As you had the app project_A, installed on the emulator_E, in previous run.
Now you started the execution of your project_A, again on the emulator_E.
The Android_Studio and emulator_E, both came to know that, the apk is already on the emulator_E, so just, whatever the new changes are, will be synchronised, within the, already available project_A apk, on the emulator_E.
But as the whole process takes some time, you uninstalled the apk of project_A on a emulator_E.
And now project_A on a emulator_E is not there, but Android_Studio tried to synchronised it, which leads you to the ERROR_1
Solution
You are following many approaches, for the same thing.
You are starting your project, project_A on the emulator_E by :-
via ADB INSTALL from the command line too
With Instant Run too
With Instant Run too
And you are not keeping the previous apk as it is there on the emulator_E, after starting the execution too.
Uninstall it from emulator_E, but before you start the execution for emulator_E. Which lead to your Android Studio to some dangerous STATE_A and, Android Studio is not tested by google for such types users
It may seem harsh, and obviously it is not the answer, but this is the exact problem, which is leading you to the such case.

Android studios doesn't update app on mobile device

My problem is that when I ran my app and use my mobile device the app isn't updated with any of the changes I've made to the code. I've checked the 'Android Device Monitor' and it sees my phone. Yesterday I downloaded 'universal adb driver' because I was trying to print a logcat. I thought that downloading this driver despite already having USB google driver might have caused the issuse. I've uninstalled univeral adb driver but the problem persists. Can anybody help me
I know I am late, but if anyone else comes here, run Build>Clean project.
It's a bug in Android studio. That crap is ancient, and still not fixed.
You need to go to Run > Edit configurations... and disable the "Allow parallel run" checkbox at the right top corner of that window, it will even solve the problem that your activity don't run after app build. It's only one solution which was helped to me.
Simply uninstall the application from your mobile device and then run your app again with your device connected and make sure to select the correct device when Android Studio prompts you to.
Try Re-build the gradle. I should work for you. Sometimes if the build id processing and your usb cable is removed or not connected properly, there might be chance to get this issue.
Also, Check the error logs in the studio. They will tell you what exactly you need to do.

Xamarin : Application not installed issue

When I install my application in debugging mode on my Android mobile device, it seems to be installed.
However, after signing the application and publishing it, it's not installed on my phone. (Release mode)
It says: Application not installed.
I tried a few things but cannot resolve this problem. I also tested with another Keystore but it still cannot be installed.
I verified Xamarin Studio options but everything is OK, does anyone have an idea?
The correct process of creating apk is given below
First change your build type to Release from debug.
Clean
Rebuild
Right click your android project and click on archive
After successful archive click on Distribute and click on Ad-hoc
Create keystore file
After finishing click on Open Distribution
Your apk file is ready.
I know I am late in party. But I believe it could help someone to resolve his issue.
Sometimes the issue is unsupported Architecture.
You can resolve it by
Android Project>Properties>Android Options> Advance>Supported Architecture.
Here you can check the supported architecture according to your device and the issue would be resolved. (I believe app should support maximum of architectures so check them all).
Hope it would help.
For OS X and windows the commands are same:
For windows please download: MSBuild Command Prompt for VS2015
For release version (the actual problem you are facing): type in command tool:
msbuild /p:Configuration=Release Path\To\Your\ApplicationProject.csproj
If this doesn't explain your problem I would post directly on their forums or contact their support. That could also help if you could find the installation log, there is probably an explanation why it fails to install.
I found the solution here https://forums.xamarin.com/discussion/comment/72399/#Comment_72399.
The answer from Felix Alcala works perfect. No more "App not installed" messages on device.
Open the SDK Locations in Xamarin Studio
Preferences/Projects/SDK Locations/Android
and set Java SDK(JDK) to
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Finally, generate the .apk file again.
Check the target sdk when debug and check version of your android device.
Version of android device should be equal or greater than the target sdk in debugging mode.
You may encounter this issue if you have installed then uninstalled the same app from your phone.
In Visual Studio, go to
Tools > Android > Android Adb Command Prompt
Ensure your phone is connected and debugging is enabled on your phone. If this is done properly, the name of your phone should show in Visual Studio next to the run button.
In the adb command prompt, enter this command:
adb uninstall [your package name]
E.g.
adb uninstall com.mypackage
You should then be able to install your APK
This also happened to me, after downloading the .apk from my android device browser and pressing the Install button, it said "App not installed" with no further information. After downloading it several times, (each time getting the same issue) I finally got the message that I could not download de .apk because I did not have enough storage in my device. So, check if you have enough storage in your phone before trying to install it, as the error message is only "App not installed" instead of warning that there is not enough space.
Google Play scans the device for threats before installing anything from unknown source. When you try to install for the first time, it will ask if you want to install, if you let it install it'll work fine. But second time, even if it asks or not, it won't let you install. One solution for this is, go to your play store, under Play Protect disable ' scan device for security threats' and then install it, it should work! One other reason for the error could be that app is already installed in your device, uninstall the app or change the signature and then try to install it, It should work! If these don't work, try to debug through usb, adb would show you the error and then you can work on that!

Android Logcat is empty when debug with device in android studio

When I try to debug using android device in android studio Logcat shows nothing. But when I use emulator LogCat shows all the messages. How should view the Logcat messages when debugging on actual device?
Thank You !
In Android studio 0.8.0 you should enable ADB integration through Tools -> Android, before run your app. Then the log cat will work correctly. Notice that if you make ADB integration disabled while your app is running and again make it enable, then the log cat dosen't show anything unless you rebuild your project.
Restart the phone. And it solves magically
I was using Lenovo A7000plus powered by Android 6.0 M and found out that my Android Studio was unable to record the debug process, but somehow other's phone debug report could be recorded. Plus, I tried use Memu emulator and it recorded normally.
Strangely, that device was recognized by Android Studio and ready to be debugged, but no recorded debug report at all from all application that ran on the device. Of course, USB debug was tuned on.
What I did before, I turned off Developer option on that phone in order to play my favourite mobile game (F/GO) which forbids USB Debugging is turned on in the device.
A few hours later, after trying any method in Internet and not success, accidentally I found simple but strange solution that is Restart the phone. I restarted the phone while it was connecting to PC, and somehow the logcat showed all debug process in Logcat like normal.
It sounds like non-engineering solution at all, but that's really work for my case.
As of 0.4.0 I have noticed that the logcat tab does not work in the debugger window - only in the Android DDMS window (hit Alt+6 to bring up the working logcat while debugging). Awkward I know :)
In Android studio 1.0.2 or later: you should enable ADB integration through Tools -> Android, before run your app
In Android studio 1.* if logcat messages have disappeared for me helps the next trick:
Tools -> Android -> disable )) "enable ADB integration" (if it've been enabled)
Tools -> Android -> enable it again "enable ADB integration"
In 0.8.2 the DDMS window doesn't show up. However restarting the adb logcat windows by pressing Alt+6 (Twice, if it's already opened) fixes the issue. It worked for me.
I understand that this question is over 2 years old, but from my searches a few people are still having a persistent problem with this. One possible solution to this (which worked for me after two hours!) is that your phone settings may have its "Log Switch" set to off, hence it isn't sending your log data to the IDE.
Here is the solution - "Unable to open log device '/dev/log/main': No such file or directory"
Hope it helps!
If anyone's still having trouble with this despite trying all the answers here, just use System.out.println instead of log.* and your debug messages will output.
Updated: I finally got the cause of the problem in my case. If I switch of my device's wifi, the log shows. Otherwise, the log will not show. I tried several times and it the always show full logs when I turn off my wifi.
My device is: Gsmart Classic, OS: Android OS, v5.1 (Lollipop). I met the problem when I updated the gradle build tool from 'com.android.tools.build:gradle:2.0.0-alpha1' to 'com.android.tools.build:gradle:2.0.0-alpha3' in Android Studio 2.0-preview. After trying all the solutions with no luck, I tried un applied all the instant run choices and re-apply it again. Then the logs show up.
Note: if it still doesn't help. You can as well try to switch back-and-forth the back ground process limit. Unfortunately, I couldn't reproduce the error.
In Android Studio 2.x I used to have to restart to get it working but often switching back and forth between the applications works or running
adb kill-server;
adb start-server;
to restart adb fixes many things as well.
The problem seems to have different causes.
For me, the issue was that I had two emulators with the same name (I created it, deleted it, and then created it again with the same name). There were two emulator entries in the logcat dropdown and it was connected to the wrong one. All I had to do was switch to the other one. I prevented the problem permanently by renaming the emulator.
I believe that the problem has various causes for different users. I experienced the same issue with logcat not displaying any information when my application crashed, and we all know how frustrating this can be.
The following are the solutions that worked for me.
Invalidating caches and restarting android studio
In the developer option in your physical device make sure the logger Buffer size is set to 1MB per logger buffer.
Restart your physical device.
Hope this helps.

Debugging android app does not install on emulator or device

I was having an issue with debugging my app with eclipse. When I go to debug on either a real device or on an emulator the process goes fine except on the console it gets stuck saying "app_name.apk installing....". There are no error messages and I even tried it with the standard hello world app. I've never had this issue before with my previous app, however I have updated the SDK since then. I have debuggable = true, and do have the block in the manifest which is a common problem. I also set up the real device for unknown sources and debugging. I didn't know if anybody else had this problem and fixed it ? Maybe its an issue the ADB?
Finally got it to work, uninstalled eclipse and the SDK and got the newest version from google. Previously eclipse wouldn't let me update the ADB and I'm assuming that's the root of the error. Works fine now and the new version of eclipse looks super classy.

Categories

Resources