Unable to install an application via Android Studio - android

I'm currently coding an android application, and since yesterday, my phone refuses to install it. I've checked the logs available via ADB, and I found a line saying: PackageManager: Package com.package.example signatures do not match previously installed version; ignoring!. So I decided to manually uninstall the previous version, but the error still remains, and the installation fails again and again. Does anyone know how to clean previous installations? I've tried to wipe cache from EMUI mode too.
My phone: Huawei Mate 20 pro
EMUI version: 9.1.0

Remove the application for all the users.
You need to uninstall it because you are using a different signature than the original. If it is not working it might be because it is still installed for another user on the device. To completely uninstall, go to Settings -> Apps -> Options (the three dots on top right) -> Uninstall for all users

Related

Android Studio not installing app on device, no error messages

I have a clean Android project on Android Studio (just with a "hello world' screen), and I'm trying to install the app on my Samsung Galaxy S10e.
I click the Run button, and this is what I see in the Build Output:
And the apk is generated successfully.
But it's not launched and not installed on the device (no icon, and it doesn't appear in the apps list).
When I try manually installing the apk by adb install app-debug.apk, it works. The app shortcut appears on the device, it's added to the apps list, and I can launch the app.
At first also adb install didn't work, giving out the error INSTALL_FAILED_TEST_ONLY, but I solved that by adding android.injected.testOnly=false to gradle.properties.
I tried changing Gradle version to 6.0.1 (looks like this is the latest at the moment), and it didn't help.
I also have my device selected at the top:
How can I make Android Studio install and launch the app on my device?
Android Studio version: 3.5.3
Edit:
I'm seeing the same behavior on an Emulator. I opened AVD from Android Studio and chose Pixel 3A. The emulator opens up, I run the app, nothing happens on the emulator (and I see the same Build Output messages).
The same happens to me. It is probably a bug in Android Studio. At the second compilation the app installs correctly. It is tedious.
There isn't enough information to find the cause of this issue.
But since it works with adb, it means you run adb command. There could be only one instance of adb daemon running. So if it's involved externally my guess is Android Studio won't have access to it.
Possibly try adb kill-server and running again from Android Studio and see if that helps.
I encountered the same problem, which I solved by checking the running devices. The connected phone had 2 accounts (might be personal & work) which was listed on the list of devices, so I had to select the second option, and it ran successfully on my phone. see the attached image.
One thing it might be:
Enable usb debugging
Settings
System
Developer options
Turn the setting on for usb debugging
If it does not appear go to settings about phone. Then click on build number like 7-10 times and it will enable you to have the developer options appear.

APK which I developed used to work fine earlier, but suddenly stopped working with "App not installed" error

I was working on an android app to push FCM notifications.
Now this debug app was getting installed on my mobile properly, however since am using my office laptop with intel-vt (HAXM) disabled I could not use the emulator and since the USB is also disabled, I could not use the ADB to side load.
So I was left with building the APK and manually side loading it on my mobile every time I made even a small change.(Redmi Note 5 Pro).
Now this app was working fine till the last time I uninstalled it.After which I tried to install the new version which failed with error "App not installed". Then I went on to install the older version thinking I might have screwed up something in the latest version, however all the older version APKs which were working absolutely fine earlier (at least they were installing i mean) stopped getting installed with the same error.
I have already uninstalled the older version and have double checked from system and there is no earlier APK existing on my mobile.
This is driving me crazy and has put a complete halt on my work as this is the only mobile I have. And yes I have tried restarting my mobile, I have even disabled MIUI optimizations from developers menu.
PS - I am an extreme noob at Android and have recently started with Android development so please forgive me if my question sounds very silly.
Appreciate any help I can get on this.
Please follow the following steps:
Go to Settings -> Permissions -> Install via USB: Uncheck your App if
it's listed.
Go to Settings -> Additional Settings -> Privacy: Check the Unknown
Sources option.
Finally go to Settings -> Additional Settings -> Developer options:
Check the Install via USB option.

Android Studio not running application

I'm having an issue where the app I'm working on is not deploying to the device when I'm ready to test it out. It used to do it just fine, but then I updated to 5.0.1 Lollipop, which I believe to be the culprit. Besides downgrading back to 4.4.4 KitKat, which is quite the process on my bootloader-locked Galaxy S4, what can I do to resolve this? ADB recognizes my device and the project builds with no errors/warnings. However, the app does run and work normally if I build the signed APK manually and send it to my device via email/PushBullet which is just a lot of extra, unnecessary steps.
I'm sorry for the lack of information, I'll update as tips come along as to what I've tried. I don't know where to start. One thing I have tried was changing all compile sdk versions to 21, but no dice. It does pop up with the green bubble "session 'app' running" but nothing happens on the device. Also, the ADB pane reports "no debuggable applications." The big issue here is that I can't debug my applications at this point since I can't view the logcat. Any help would be greatly appreciated.
My phone has SuperSU (a rooting app) which updated and caused this problem. As part of the update it had switched off the preference to allow processes running as system user to gain root access without confirmation. I simply enabled the 'Trust system user' option and it worked as normal.
Hope this helps someone :)
Please un install the application if already installed and install again.
there is a kind of issue that application installed but not auto launched. You nee to launched explicitly but If app is already installed then you can't identify that your new installation works or not.
Once un install and install again and track if found installed.
Open the "Edit Configurations" pane and click the '+' button. Select the option to create a new 'Android Application' and then select the correct module. Apply, and you can then delete the test configuration you were using before if you wish. Then everytime you run, make sure you are running as an Android Application and not a test and it will auto-launch on install.
It turns out on my device (Galaxy S4 Lollipop) they added a security feature which didn't allow for ADB installs. The solution was to get root permissions and install adbd Insecure app from Chainfire and run it. Works flawlessly now.

android installer is showing as update despite of absence of previous versions

I created an app with LiveCode and installed it on my tablet (Jelly Bean 4.1.2) few times. I'm not able to install the latest version of the app nor the older versions that were installed without any problems before. When I tap to install the app the message asks if I want to install an update to existing application despite that the previous versions are uninstalled. When I tap on Install the message comes: "App not installed". The app is about 7 MB and I have plenty of space on the tablet. What is the reason for this problem and how to fix it?
Changing the app Identifier in the standalone settings fixed the problem.

Error while Installing Android app on Android virtual device

I have created a small and simple android app. I tried installing it on an actual android device. But because it won't install, I created an AVD resembling my phone. I tried copying and installing app on that AVD and it still says that error. "Application xxx could not be installed on this phone".
Before I tried installing my app on the phone or AVD I following steps:
1. Exported an unsigned copy of application onto my hard-drive.
2. User jarsigner to sign the app
3. Verified with jarsigner that my app is signed properly.
4. Used zipalign to optimize the app resources.
I do not have an icon assigned to myapp but mandatory properties like version etc. have been specified properly.
I had initially developed app using 2.1 version but because of compatability issues with my phone I reverted code to compile on 1.5 and it still doesn't get installed either on AVD or my phone.
My AVD is on 2.1 though and code is compiled with 1.5.
Is there a place where I can see the logs as to why app is not getting installed. It would be really helpful.
Cheers
This can happen if you have a Debug version installed on the device already (from a USB debug session). Either do adb -d uninstall com.example.yourapp or uninstall in the Preferences->Applications screen on the phone itself.
Try using adb install to see if you get an error.
adb logcat will give you the logs from your device (phone or emulator) so you might find a stacktrace there.

Categories

Resources