Android .apk installation - Application not installed - android

I've installed the appropriate .apk file, however when trying to install it the app it gives me the error 'Application not installed'. I've tried to put a simple Hello World .apk file on there and I receive the same message.
Here's what I have tried:
1. Adding the following to Application Manifest
android:debuggable="true"
2. I have installed multiple File Managers including Astro, Android File Manager and ES File Explorer
3. I have enabled all of the correct settings on the Sony Xperia U (running Android 2.3.7)
4. Tried installation whilst the device is plugged in, and whilst it isn't
I'm using a Unsigned Android Application. Everything runs accordingly on the Eclipse emulator
Logcat is reporting the following:
This is displayed even when my device is connected via USB.

Locate your myapp.apk file on your hard drive:
Install it via command line:
C:\android\android-sdk\platform-tools\adb.exe install myapp.apk
List of connected devices:
adb devices
Connecting a device (if its number is 5554):
adb connect 127.0.0.1:5554
Restarting ADB:
adb kill-server
adb start-server

Your APK is having an expired or mis-configured certificate.
You need to resign the apk using the following tools.
https://play.google.com/store/apps/details?id=kellinwood.zipsigner2&hl=en
or
https://code.google.com/p/apk-signer/
Sign the APK with output filename as HelloWorld_signed.apk
Then go to my files you Will see your signed apk.
Install HelloWorld_signed.apk.
The app Will install successfully..

I believe there is a constraint of permission to prevent you to do so, I have worked around and find a simple solution for my Sony Xperia 1, OS version 5.1.1
Go through these steps:
Settings
Apps
Download Tab
Scroll down to find your app there
Press the menu and select Uninstall for all users

Related

Install/Uninstall action not allowed on Wear

I am developing an app for a wear device and I wanted to include the possibility to update the app by pressing a button.
This action will download an updated version of the app from a private server and run the .apk file to install, for that I have been following the code on this answer.
Everything works as expected on a real android phone but when I try to run the app in a wear device, it works to the point of downloading the updated .apk file, but the installation fails with the following message:
I was wondering if anybody could provide a better way to add update feature to an Android Wear app.
It looks like PackageInstaller is denying installation of arbitrary APKs (see code here), so you're probably out of luck. Installing arbitrary APKs is not usually an action which is possible as it requires being a system/privileged app (it should require android.permission.INSTALL_PACKAGES, and the only other app on the device which supports installing packages is most likely Play Store.
If you want a way to update things automatically you're stuck w/ putting it on Google Play.
So this answer isn't the best way of getting around something. But, if you want to download and install an APK File that is not in the Android Wear Google Play Store. You can use ADB and sideload the APK From your computer.
Here is how to set it up
Have you're built APK File
Depending on your System, install ADB
2a.Windows - Go to here https://forum.xda-developers.com/t/official-tool-windows-adb-fastboot-and-drivers-15-seconds-adb-installer-v1-4-3.2588979/ and install the latest patch
2b. MacOs - brew install adb
2c. Linux - sudo apt-get install adb fastboot -y
On your Android Wear Device, enable ADB Debugging
Connect device to computer (can be usb connection) or via Bluetooth (very slow, but not all Android Wear Devices have a USB Connection to them)
Now type adb devices to start the adb server and click allow on your android device
Time to install apk file - type: adb install path/to/file

Manually installing an updated APK fails with "signatures do not match the previously installed version"

I've built a silly app to share among a few friends. No need to put it up on the app-store.
I built the first apk (signed), uploaded it to a web-server and all worked well.
A small issue arose, I fixed it, re-built, signed with the same keystore and uploaded it again. It now seems that I am unable to install from the new apk. The debugger tells me:
signatures do not match the previously installed version
So I uninstalled the old version by opening the app drawer and dragging it onto the "uninstall" button. When opening "Settings -> Apps", I don't see it anywhere anymore. I don't see any traces of the app on my device.
Yet I still get the above error message.
Is it possible some information still lingers on the device somewhere? Is there any way I can verify that?
Yes It is possible if somehow your old application is not removed 100% or its data is not removed.
Try:
adb uninstall "com.yourapp.yourapp"
If you don't know exactly what to put as replacement for "com.yourapp.yourapp", then you just open Android studio, Run your app while it is connected to a device and then look at Debug window.
It says:
Waiting for device.
Target device: samsung-sm_t531-xxxxxxxxx
Uploading file
local path: C:\Users\myapp\app\build\outputs\apk\myapp.apk
remote path: /data/local/tmp/com.myapp.myapp
Installing com.myapp.myapp
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.myapp.myapp"
pkg: /data/local/tmp/com.myapp.myapp
Success
com.myapp.myapp in this case is the name of the package you must use to uninstall.
I had the same issue and the adb uninstall solution did not work for me.
What worked was
On your device go to to Settings->Apps
Select your app, and in the menu select "Uninstall for all users"
Even if I had previously uninstalled the app it was still in the list there.
To me, if the app is meant to be distributed, the adb solution is a no-go: you can't ask one's friend to have the android sdk installed on their machine !
The way to go here is to edit the AndroidManifest.xml and to increment the android:versionCodeattribute in the <manifest>tag (which is the root element).
This would update your installed application
If you are seeing this while conducting connected tests, make sure to include .test when uninstalling via adb because uninstalling via app -> settings does not get rid of the test package
adb uninstall your.broken.package.test
if you just uninstall via
adb uninstall your.broken.package
your test package will still be there. This was only something i noticed while using the gradle command line, haven't come across this problem within android studio
Uninstall the old app from your phone or emulator and try to run again.
I got that error while trying to install release while signing it's certificate.
fixed with the :app Gradle task uninstallRelease and then installRelease again
If you are going in install the same app with a different signature, you may want to uninstall but keep the app's data.
adb -d shell pm uninstall -k <packageName>
adb -d install -r -t -d app.apk
For Unity users who come to this question, the best answer is indeed the one above by #Ehsan
adb uninstall "com.yourapp.yourapp"
I had already installed a previous version on my Android device then selected Development Build in Unity > Build Settings which caused the APK to use a different signature. If you install through the Android GUI it doesn't actually remove everything so you have to use ADB.
I had face same problem With POCO Mobile and Moto G30 Mobile while developing application in flutter
My Solution is:
I have open android project which automatically create in your project, in android studio and run project in connected device. It will automatically ask to uninstall old app with same package name and different signature. After click ok button it will install app.

App won't install on physical device - AndroidStudio

Yesterday i created my first android app (a simple app with two buttons showing two simple toasts). In Android Studio if I run it in the virtual device it works fine, but when I try to run it on my phone (I-9195 with android 4.4.2)the console says:
Waiting for device.
Target device: samsung-gt_i9195-0220d6fa
Uploading file
local path: C:\Users\Stefano\AndroidStudioProjects\Prova1\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.example.stefano.prova1
Installing com.example.stefano.prova1
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.stefano.prova1"
and it sticks here.
If I try to move the apk to the sd and then install it the phone shows an infinite "installing" and I have to exit to the home page.
If I try to install it via adb with the cmd the output is:
C:\Users\Stefano\AppData\Local\Android\sdk\platform-tools>adb install "C:\Users\Stefano\AndroidStudioProjects\Prova1\app
\build\outputs\apk\app-debug.apk"
2712 KB/s (936775 bytes in 0.337s)
pkg: /data/local/tmp/app-debug.apk
and it sticks here.
I activated in the developer options the usb debugging and I allowed the pc, adb recognizes my phone ,I tried to restart adb but it didn't helped.
Can someone help me?
To rule it out, have you tried installing another app from the Play store or similar? It would be interesting to see if they can install okay.
It may be that there is another process blocking your installation.
If you are unable to install from the Play store then try the following:
Settings > Apps > All > scroll down to Google Play Store > Force stop, clear cache and data for the app
Attempt to download another app from the store and if that succeeds then you should be able to install your app via adb.

installing .apk file in actual device only for testing

I want to test my application on actual device, so how can I go for it? And is it accessory to sign in and use zipalign for this purpose, or they are useful when preparing for publish my application? And is there any way to test my application on actual device without using eclipse?
download and install Android SDK
Make usb debugging enabled in your device
Connect your device to computer
go to command prompt and write: "adb devices" this will list all the devices connected
adb install "path/App.apk"
and you are done. Please note that adb command will run correctly from anywhere if you are having a correct path pointing to android sdk / plateform-tools direcory
I hope this will help you
Yes u can directly install your application into actual device without signing and zipalign. You can install the drivers for your software into your computer and use you device directly for debugging alternative to Emulator
Refer Using Hardware Devices
or you can install using Android adb tool Refer Installing an Application
or you can directly copy your application package file to you sdcard and install
The easy steps to install your apk using File manager :
Copy the APK
file you want to install to your phone's memory card.
And disconnect Phone from USB.
Go to Android Market and search and download Astro File Manager.
Click on the Install button.
After it is installed, open the app (Astro).
It will show you your application APK file stored directly in the root directory of your memory card.
Just tap on the application you want to install
Tap on “Open App Manager”
Click Install
You are done!
P.S: Don't forget to enable Unknown sources in Settings > Security.
And when installing via Eclipse enable USB Debugging > Developer Options
Some tips:
http://developer.android.com/distribute/open.html
You can install .apk files directly to your android device using the following steps:
Write click on your .apk file and choose send to -> your device
You can access it using "Astro File Manager" (downloadable app from play store) also you can click phone menue button
go to "My Files"
Select your .apk file to install it.

How to test what will happen when you publish an update to your app to the Market

I'm about to publish a new version of an app to the Market. In order to avoid any potential problems once its been pushed to the Market and people get notified of an update, I'd like to simulate that process on my phone using the .apk for the new version of the app I'll be publishing.
For instance, it has an update to the SQLite DB it's using.
The closest I can find is using the Android Debug Bridge (adb) using the command:
adb install C:\myApplication.apk
with my phone attached to my PC via the usb cable.
(the parameter represents wherever your apk file is on your PC).
When I do this, if the app is already installed on my phone, I get an error message:
Failure INSTALL FAILED ALREADY EXISTS.
If I delete the existing app from my phone, the adb install command works fine.
So, it looks like this can only be used to install an app that doesn't currently exist on your phone.
Is there any way to simulate the update process?
It'd be nice if there was an adb update command, but I don't see that.
Try using option -r to adb install:
adb install [-l] [-r] [-s] -
push this package file to the device
and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its
data)
('-s' means install on SD card instead of
internal storage)
The closest I think you can get is to put the APK somewhere, and download it on a phone. That is about the closest you can get to the real market situations, with the only difference being that you need to add the "unknown sources" option.
(on a sidenote: you can get an error installing an apk with the same package-name, but a different signing.)
I think your error is because you have the market signed version installed and your trying to install a debug signed version. If you sign it with your market key it should install fine.

Categories

Resources