Error when installing Android apk on device - android

I have this strange error when installing apk on device, from Eclipse. The console gives error message: Failed to install, but in fact the file is installed.
Also, the application doesn't start after the installation, I have to do it manually.
I have done the this same procedure over and over again, without problems, but now the error occurs.
Thanks!

I've found that sometimes a device gets stuck in a strange state, and no matter what you do will give odd errors on install. Turning the device itself on and off again usually cures the problem.

Does your ADB work normally when issued from command prompt? Try installing any apk manually using
adb install <filename.apk>
and see what is being returned. It may be an issue with the return from adb not being correctly recognized by eclipse. I'll also suggest changing the USB port to check if the same issue is occurring.

Try to remove the app on the device before installing the new apk...

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.

Error while Installing APK Android Studio 3.3

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

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!

windows-7: could not run android apps on device

I'm trying to import android applications from other computers. after sometime they're running on emulator finally now but not on the device .
probably the reason is the driver I installed , because adb devices did not recognize the device so I installed this manually and still Bluetooth Peripheral Device not installed when I check in device manager!
at first it gave me this error : the app stopped running unexpectedly !
now the error is :
Re-installation failed due to different application signatures.
You must perform a full uninstall of the application. WARNING: This will remove the application data!
Please execute 'adb uninstall com.newboston.aida.android2' in a shell.
Launch canceled!
any idea how to solve this?
I just typed adb uninstall and then the name of the package in command prompt and it works !
Uninstall the application from android device or emulator, and try to re-run / install the application. Because debug.keystrore is different for every devices.
Try to create a new virtual device. Maybe it'll work when you install the driver first. It's possible, that your phone will be recognized then. And I don't think win7 is the problem.
If possible can you just Change the Package name of the current working project. And try to Build it. it might get other path and would run. This is a kind of Patch i know, but just try it out....
I get the same problem while moving the application from one system to another... some time the problem comes due libraries path and the api level.
So you can check the api level is the same in the application buildpath in the other system.
Hope this will help you.

install Exception device not found ANDROID

After
increasing the timeout period
trying kill server and start server commands
restarting avd
recreating avd
restarting the application
restarting the system
I'm still getting :
Failed to install DataAttach.apk on device 'emulator-5554': device not found
com.android.ddmlib.InstallException: device not found
Launch canceled!
What can be done in this case?
I'm running this app on Emulator (Android version 4.0)
Edit
Apps doesn't have any issues as far as code is concerned. Still they are showing error about device not found exception.
I was also getting the same error, but to my surprise the application was installed correctly and I could launch the application. I am sending this reply just to let you know guys if you want to check and see if your application was actually installed along with this error.
Using Project->clean option before run solved the problem for me.
This has to be sorted out by manually installing the apk through adb command prompt.
After navigating to tools folder from comand prompt,use
adb install DataAttach.apk
(where DataAttach refers to package name, as in my case package name is DataAttach.apk)
I have gone through the all the trick mentioned here. But it was not successfull.
After that I restarted my device and everything started working. I dont know the exact error but this trick helped me to resolve the issue.
If you're using a real device (not emulator) then try uninstalling the existing .apk from the device then re-run. This solved the error message for me.
Cleaning my project helped me to solve this problem.
Project->Clean->Run

Categories

Resources