Android Studio Error while installing APK - android-studio

can someone please help me understand this error
I only have one phone connected, but for some reason it says offline under connected devices inside of Select Deployment Target. I have not been able to see the app on my phone either.
02/04 17:18:31: Launching app
$ adb push C:\Users\aaron\AndroidStudioProjects\HappyBirthday\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/com.example.android.happybirthday
com.android.ddmlib.AdbCommandRejectedException: more than one device
Error while Installing APK

Clean and Rebuild your project then install

Related

Problems with launching the physical device in android studio

After i connect the device onto my android studio yet, then when I running and build Its return the code
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_VERSION_DOWNGRADE
List of apks:
[0] 'D:\MyApplication\app\build\intermediates\apk\debug\app-debug.apk'
The device already has a newer version of this application.
in the editor
I try to fix this things with some article in this site but nothing working else
In the corner of screen it has this too that i dont know what is it exactly of meaning:
failed to commit install session 495050153 with command package install-commit 495050153 .Error:INSTALL_FAILED_VERSION_DOWNGRADE
So,this is the problem when running
and
after click Ok then its getting error thiss
, and also I when open tab running devices its still apppearing just only run this debug then its get this error
.Thank you for helping me this problems
You can uninstall the application from your device first and then install the fresh one .

Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again

Edit: tns run android works on android-studio ide but not on vscode. I got it running in android-studio by clicking the configure in the picture below:
I'm new to nativescript and android studio scene and configuring things out is really a hell of an experience, I got this existing project that I got running yesterday and when I try to run it again today with tns run android it now don't see the emulator that I have installed and the same emulator it used to run just yesterday. Here are the details of my config:
Installed Packages:
Path and Environment configuration:
Now if I run tns device android --available-devices this show up:
And it still insist that it cannot find any devices when it just found one!
Running tns-devices can't find it as well:
It also says All is good when I run tns doctor:
So my question would be, what am I missing here? Is it a missing package? Is it a wrong android configuration? Do I have to reinstall android studio from the start (Already did this twice!)
What worked for me:
restarted my unit.
ran the emulator from android studio.
ran tns run android on vscode.
and it just worked. Also, this might help you as well.

Is there any way to make an apk run on emulator?

I have an apk that does not install on emulators or tablets, I was wondering if it has any method?
Already opened the file with android studio, apk clone enter image description here
I get this message:
The app does not support this device, install and use on your mobile
Try getting an app such as BlueStacks, it should be able to run APKs.

Android Studio does not install app after using the Internal Test Track version

I've been working on my app for a while now and recently uploaded it to the Google Play Console's Internal Test Track. I installed my app via Google Play Store and it worked fine.
But if I now try to install an updated debug version via Android Studio directly it just launches my main activity without installing the changed app.
What I've tried:
Uninstalling app and running in via AS: "Error: Activity class {...} does not exist."
Restarting phone
Restarting AS
Reconnecting phone
Uninstalling app via AS (gradlew uA)
Uninstalling app via app manager
Invalidating AS cache
Cleaning / rebuilding project
Disabling Skip installation if APK has not changed in Run Configurations -> Miscellaneous
Increasing version number
What may cause it:
The Internal Test Track version is signed, but the key is kept by Google
The app is not selected as 'App to debug', but the dialog to choose one, does not offer it
How can I install my unreleased version via Android Studio directly again?
Thanks in advance. -Minding
QUICKFIX
The "Gradle Aware" task was missing for some reason. To fix it "Run" > "Edit configurations" > "+" > "Gradle-aware Make" > "OK" (leave the field empty) and restart.
The Android Studio team is still investigating why this happened.
Old answer / Workaround
Using the ADB to directly uninstall the release version and installing the debug version worked, but you have reinstall the app for every change! A better solution would still appreciated.
Build your project's debug APK
Enter the following into the terminal:
adb uninstall MY_PACKAGE_NAME
adb install -r ./mobile/build/outputs/apk/debug/mobile-debug.apk
If you get "adb" not found. use %LOCALAPPDATA%\Android\sdk\platform-tools\adb instead.
Select the app to be App to debug in the device's developer options.
Hope this help. -Minding

After updating to android studio 3.3 the apk that is built with android studio not working

I have updated my android studio and after that, I have a kind of problem which will encounter when I want to install the APK with Android-studio. When I hit the play button The app builds successfully but it won't install on my ( or any ) device(s) not via ADB nor from manually putting the APK on the device then installing it.
I have tried building it from the command line gradlew assembleDebug and it works, it builds an APK and when I put it on the device it gets installed. I have turned off Experimental Only sync the active variant that was no good. I have changed my compileSdkVersion from 27 to 28 that was no good either.
Can anyone please help me to solve this issue. Thank you for your time.
Update 1
I have deleted .gradle folder in the user directory, re-installed the Android-studio, deleted the .idea folder and .gradle folder in the project directory but no luck still can't install the app after building.
Update 2
if I install the app by adb install app-debug.ak the result is:
adb: failed to install app-debug.apk: Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI] ( Note: This is with adb in the terminal and nothing have to do with Android-studio )
And I can install it with flag -t
Update 3
This is the run tab after building the app and Trying to install.
Update 4
I have un-installed Android studio and then re-installed it from an installer still the problem exists.
Update 5
There is a blinking Emulator in my Select Deployment target named: emulator-5554 [OFFLINE] And when it is trying to install I think it has to do something with this.
Finally, I installed my windows again and it started working.

Resources