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!
Related
I decided to generate even more money and develop my first app for Android. When I want to deploy my app (just the skeleton code from IntelliJ/Android SDK) with one MainActivity I am getting the following error.
The log of the run looks like this.
5/07 21:32:35: Launching app
$ adb install-multiple -r -t
C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_7.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_6.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_8.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_9.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_4.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_5.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_3.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\resources\instant-run\debug\resources-debug.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_0.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_1.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\dep\dependencies.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\split-apk\debug\slices\slice_2.apk C:\Users\Tony\Code\Java\PureWallpaper\app\build\intermediates\instant-run-apk\debug\app-debug.apk
$ adb shell pm uninstall com.stark.purewallpaper
Unknown failure: Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown package: com.stark.purewallpaper
at com.android.server.pm.Settings.getInstallerPackageNameLPr(Settings.java:4671)
at com.android.server.pm.PackageManagerService.getInstallerPackageName(PackageManagerService.java:25342)
at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:25348)
at com.android.server.pm.PackageManagerService.deletePackageVersioned(PackageManagerService.java:21062)
at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:924)
at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:1486)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:193)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:25884)
at android.os.Binder.shellCommand(Binder.java:642)
at android.os.Binder.onTransact(Binder.java:540)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:3329)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4763)
at android.os.Binder.execTransact(Binder.java:739)
Error while Installing APKs
The event log looks like this.
21:32 Executing tasks: [:app:assembleDebug]
21:32 Gradle build finished in 493 ms
21:32 Failed to finalize session : -118
Things I tried on the phone:
re-enabled dev mode
re-enabled USB debugging
tried different default usb configurations like "picture" or "file" transfer
tried activating "wait for debugger" option
Things I tried in IntelliJ:
deactivated "Instant Run"
installed all SDK tools, including the "Google USB Driver"
cleaned and rebuild the project
IntelliJ can clearly see my device, it even detects the type correctly.
I am on:
Windows 10
IntelliJ 2019.1.1
Newest Android SDK that comes with IntelliJ
I decided to try this on Android Studio 3.4 and I'm getting same error.
I am able to run the app inside the emulator/virtual device but not on my Samsung Galaxy S10+. Any ideas?
If none of the solution mentioned above works, you can turn off the instant run option as shown in the from setting
Try this:
Build > Clean Project
Build > Rebuild Project
Build > Make Project (Ctrl + F9)
Try to use this File > Invalidates cache/restart
Lastly, try to sync project with Gradle file which can be found in the right corner top
I finally, after days, found out what it was. My company forced a security policy on my phone after I configured the e-mail app to receive work mail. After deactivating the policy in security settings I was able to deploy the app without any problems.
Go to your Apps menu from your Android device Settings.
Find your app, probably name is PureWallpaper according to your logs.
Uninstall it.
Then try to install it again.
Explanation:
According to your error logs, it looks like your device has the same app installed but with different signature signed with different keystore.
This was happen to me many times ,
This is just a warning ,It try to say that the app you want to install on your device is already installed on your device ,but the problem is it is signed with different credentials .
For eg:-
their was a release apk of the same app installed on your device and you are trying to install debug apk on same device.
This error also try to say that the that all the data which are saved by that apk will be lost.
Side note:- after clicking OK,sometimes android studio gives me error that it is unable to install but actually it installed.
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.
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
Getting error while installing apk via android studio.
Failure [INSTALL_FAILED_INTERNAL_ERROR]
DELETE_FAILED_INTERNAL_ERROR
Error while Installing APK
i tried build:clean
also restart device..
error not resolves.
Disabling Instant run fixed it for me
Go to Preferences>Builld,Execution, Deployment> Instant Run
Then unmark Enable instant Run to hot swap code ...
Sorce from the comments in here
And also don't forget to report the issue to google to be fixed faster.
I have solved this problem by turning off MIUI optimization.
For this go to setting-> developerOptions-> MIUI Optiomization.
Update:
Apart from above solution. If you are using Android studio version 3.0 or 3+ then we can not directly use the apk after running on the device from the build->output->apk folder.
instead we need to build apk as stated below.(this is not a signed apk)
go to Build -> Build Bundle(s) / APK(s) -> Build APK(s) then copy the apk from build -> output -> apk -> debug
and then you are good to go.
There is only one answer to this problem, Disable Instant Run. I also faced the same issue and resolved by disabling instant run. Below are steps to disable Instant Run on latest version of Android Studio(3.1.2):
Go to Android Studio Settings
Search Instant Run in search box in top left of Android Studio Setting Window OR Click on Build, Execution, Deployment
Here you will find Instant Run
By default it is Enabled, uncheck Enable Instant Run to hot swap code/resource changes on deploy(default enabled)
Click OK button at the bottom
Restart your Android Studio and try to install apk again
To know more about Instant Run, check official documentation: https://developer.android.com/studio/run/?utm_source=android-studio#instant-run
Here is one old YouTube video as well about this: https://www.youtube.com/watch?v=vuerGSylc9A
There are various issue which can leads to error “App not installed error” and to fix that we need to identify the reason for that. Read out the reasons written here.
Reason for “App not installed error” in android phone
Dimmer Application – Any dimmer app is running in your android phone then Install button will not work while installing app in your phone
Low storage – Android software and if data such as photos, videos, music, messages, Apps, contacts, emails, etc are stored in the internal memory there is not adequate storage left for another App, leading to Android App not installed error.
Corrupted App file – When you don’t download Apps from the Play Store and choose another platform to do that, Those App files are mostly corrupt and cannot installed on your device. I personally recommend you not to download apk from other sources / website
SD Card not mounted – When your phone is connected to your PC device which can access the SD Card from your device. In that situations if you install an App and choose to save it to your SD Card, you will see Android App not installed error because the App cannot find the SD card as it is not mounted in your device.
App compatibility with Android Version – Some applications on the internet which are only meant to work on some Android versions. Installing these applications on newer android versions will show error.
Application Permission – Application running in the background and App Permission are not new concepts. Such errors can also cause the Unknown Error Code during App installation.
Incorrect file – If you already have an App installed but download another variant with distinct signed or unsigned certificate can also show an error.
Methods to Fix App Not Installed Error | App not installed error solution
Method 1: Allow Apps from Unknown Sources
In android phone to install app which is not downloaded from Playstore you need to tick Install app from unknown source. By default this option is untick fro safety purpose, so if this is untick you will not be also to install app in android phone and will give you Application not installed in android smartphone. So to fix this follow the below path.
Go to Settings → Security → Unknown Sources. Enable Unknown Sources.
Now try to install App.
Method 2: Clear Data and Cache of Package Installer
Firstly Open setting of your Android device.
Tap on the option called Apps or Manage apps
Check for the Package Installer App under system Apps
You will find two option of Clear data and Clear cache. (Android Marshmallow 6.0 users check for option Storage to clear data and cache)
Clear the data and cache and you problem is solved.
Please try to cleaning your project and then check it. If it will not solved still then try to free some space from your device, because this error may occur due to lake of space in device memory. Please check with these both ways.
May be Only Disabling the instant run is the right solution. Uninstalling android studio or creating new virtual device will not solve the problem.
Setting--> expand (Build,Execution,deployment) ----> Instant Run (Please Uncheck the Enable Instant run to hot swap code option )
You might need to enable running app from unknown sources in phone.
There are different ways to turn it ON depend on the mobile manufacturer.
To allow app installs follow this steps in Android device:
Navigate to Setting > Security.
Check the option "Unknown sources".
Tap OK on the prompt message then Select "Trust".
Also in few devices, once you run your code you need to provide run time permission to allow running the App. Just Click on Allow in dialog, it will work.
This Error occur main reason is Instant run.
When you will using instant run only the updated part gets replaced on device.
Some times the application seems to not updating and it is staying at
previous build.
Solution:
You have to disable Instant Run to generate the whole APK file is updated on device.
In Android Studio:
File -> Settings > Build, Execution, Deployment > Instant Run:
Uncheck : (Enable Instant Run to hot swap code....) > Apply.
Thanks.
Android studio change the concept of Building APK
Go to Build section in android studio,
Build apk
now install this apk
I'm jumping head first into Android for Google Glass development and I'd like to know how I can let my client see the .apk that I'm working on.
My client owns a pair of Google Glass too but lives far away.
So far, the only way I have been able to upload to Glass is using ADT, Run As -> Android Application when my Glass is connected by USB.
How can I put the Glassware (apk) up online so he can "load it up" into his glass remotely? Or deploy it to his glass?
I read Send the .apk file to client for review but it's more related to Android devices, whereas my client uses Google Glass and doesn't have debug mode on (I can ask him to turn it on though) and won't root his device.
You might want to have your customer use ChromeADB -- you can see it here: https://chrome.google.com/webstore/detail/chromeadb/fhdoijgfljahinnpbolfdimpcfoicmnm/reviews?utm_source=chrome-ntp-launcher
From the comments it looks like other people are using this for similar situations.
I suppose your client owns source code so they may be glad to download the SDK at http://developer.android.com/sdk/index.html and install ADT then use the Android SDK Manager to install the SDK Platform, so they can either get your updated source and install it to Glass from ADT, or run adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb install .
Well my client has the Android SDK installed on his system and he just turns on the usb debugging mode on on his glass. Then he installs the apk using the adb install app.apk command
So far there is no other option available than this.
For Installation and testing on client side one need to follow below mentioned steps.
Download this android-tools.zip to Windows PC and extract it using any unzip tool
Copy the desired APK file (Say testapp.apk) to the extracted folder i.e in android-tools
Now open command prompt Win -> Run -> cmd -> ok
Run this command adb install testapp.apk
adb is open sourced, it shouldn't be difficult to wrap it up in a standalone application or you can rebuild adb and dependencies (due to binary license you can't simply redistribute you need to build the AOSP based code which is distributable - but IANAL)
If wrapping up commands (easier route) you can refer to these command line scripts to uninstall and run by simply passing the apk file name:
How to start an application using android ADB tools?
Hopefully this helps...
But you could use BlueStacks and have the client install the APK into the program. BlueStacks will setup a preference for ".apk" files to open up in the program itself, So no command line ADB is required. I dont know how well Glass APK's will run, however the BlueStacks emulator has come along way and work well with most general applications. So if your client has either Mac / Windows, they can easily setup an the Android emulator and can run your APK's. They could always just setup the Android SDK and use the standard emulator, It still will wont resemble a Glass device, however this could help the client understand what you are doing in the app. Its worth a try at least.