Android Studio is not installing app into device - android

My device is running android Lollipop 5.1 with Developers Options enabled and USB Debugging option checked. When I hit the RUN button on Android Studio it shows the following in the event log:
Target device: qmobile-lt500-D5180B1R63091071
Installing APK: C:\Users\Umair\AndroidStudioProjects\MyApplication\app\build\outputs\apk\app-debug.apk
Uploading file to: /data/local/tmp/com.example.umair.myapplication
Installing com.example.umair.myapplication
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.umair.myapplication"
And then nothing happens. App doesn't install and open. When I click on Android Monitor, it shows events on logcat, my device name etc. confirming that it is properly connected.
Someone tell me where the problem is.

In your mobile check unknowns sources apk install on/off
And make sure in your device space is available

First uninstall app from your device if you've already installed it.
Then in your IDE do clean and rebuild,and try restarting the device and also restarting your IDE.
That should work as expected now

Related

Android Studio: Installation failed due to: 'device 'xxxxxxxx' not found'

I'm struggling with an issue connecting Android Studio to my Google Pixel 2.
When I plug my phone into my laptop, Android Studio now recognizes the physical device and shows 'Google Pixel 2' in the dropdown of devices to run the app on. When I go to run the app, it compiles without error but when it tries to install the app on my phone the connection between my phone and AS is lost (the device is no longer listed in the dropdown) and this error message is shown in the Run dialog:
06/12 17:08:35: Launching 'app' on Google Pixel 2.
Installation did not succeed.
The application could not be installed.
List of apks:
[0] '/home/kirk/Apps/xxxx/android/app/build/outputs/apk/debug/app-debug.apk'
Installation failed due to: 'device 'xxxxxxxx' not found'
Retry
Clicking the Retry link just results in it being launched in an emulator.
I've tried disconnecting and reconnecting the device, revoking the USB debugging authorisations then re-trusting my computer, as well as closing and re-opening Android Studio.
Any ideas?
Android Studio–>Preferences–>Build,Execution,Deployment–>Debugger–>“Use libusb backend”, select false–>Apply–>Ok
Sometimes ADB just need a restart.
adb kill-server
adb start-server
In my case I had a plugin to connect via wifi, like:
Android WIFI ADB
Try to uninstall this type of plugin then clean Android Studio on Invalidate Caches / Restart...
This happened to me when I was sharing Wi-Fi from my PC to the phone.
When I disconnected my phone from my PC's Wi-Fi, everything worked.
It could be an issue with ADB rather than Android Studio
I think it is problem with adb not with android studio I tried updating adb it worked for me. Try once

Android app installation: Unknown failure (Failure - not installed for 0)

Application works fine on emulator, but I can't launch application on my device (Xiaomi Mi4). At first i seed dialog with such text:
Installation failed with message Failed to establish session.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
But after I agree - i see in log this message:
Launching app
$ adb install-multiple -r <....>
$ adb shell pm uninstall com.example.app.debug
Unknown failure (Failure - not installed for 0)
Error while Installing APKs
I've rebooted device several times and plugged/unplugged it to computer, but nothing helped.
For Redmi and Mi devices turn off MIUI Optimization and reboot your phone.
Settings > Developer Options > MIUI Optimization
Problem is in Instant Run.
As Chirag Shah said - on Xiaomi devices you can disable MIU optimization - it worked for me too when I tried.
Another solution is to disable Instant Run in android studio settings.
I've remembered - I had this problem some time ago on windows, but now it occured on linux(ubuntu). I've wrote bug report to google, but problem is still here (first time it was Android studio 2.2.3 and now it is 2.3).
For convenience:
To disable Instant Run go to
File->Settings->Build, Execution, Deployment->Instant Run
Only Turning on "Install via USB" in Developer options did the work for me. Otherwise you may need to turn off MIUI Optimization and reboot again, but try the USB option first.
I solved my problem by following the steps bellow
Turn off Developer options.
Turn on Developer options again.
Turn on USB debugging
Turn on Install via USB
After following the steps I run from android studio and it was installed my app successfully.

Visual studio cordova app build is failing

Google Sdk adb fastboot usb driver installed.. there is no issues and even not alerting any error message but app build is failing..
There is no use even after installing CTP 3.1 for VS 2013.
Kindly help me on it
As Alan says, VS will try to launch the app on the device if you have selected the "device" option and are trying to run or debug the app on the device. Does building to Ripple work? If its failing only for device, Can you please attach the complete build log?
VS uses ADB to connect to the device and so even though you have installed the driver, the ADB might not be able to see the device.
Can you run the following command to see if ADB lists the connected device:
C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe devices
Also please check whether your device shows up in the windows device manager.
Let me know what you find.

Eclipse won't recognize my device

I searched trough many questions and couldn't find an answer that fix my problem.
I'm new on creating Android projects and I'm still getting familiarized with the eclipse platform.
To the point, when I run my project I get this error
No compatible targets were found. Do you wish to add new Android Virtual Device?
I changed the AndroidManifest.xml from targetSdkVersion="18" to "15" (Which is my device level, Android version 4.0.4, correct me if I'm wrong)
Then I clicked on Run Configuration and switched from "Launch on all compatible devices/AVD's" to "Always prompt to pick device", and still couldn't get the project to work.
When I reverted the Run Configuration I get this output everytime I try to run the project
[2013-12-15 21:27:28 - MyFirstApp] No active compatible AVD's or devices found. Relaunch this configuration after connecting a device or starting an AVD.
What's the meaning of both messages? How can I make it work?
Some details:
Android Version: 4.0.4
OS: Windows XP
Samsung Galaxy S DUOS
Please follow the steps
Step 1
Check if the device driver is installed successfully. If not, download the drivers and plug the device again.
Try this link to download the driver software - http://samsung-kies.en.softonic.com/
Step 2
Click Start-> Run-> CMD. (Go to command prompt)
Navigate to the android SDK platform tools path.
Type adb devices
Now you should get the device listed and a tag "device" next to the device ID
Step 3
If you get "no devices found", type adb kill-server
Type adb start-server
Now type adb devices.
Now you are good to start testing your applications on device.
You have to have Samsung Kies installed on your computer so you can have drivers for your device, also, from eclipse:
window -> show view -> devices
if you don't see your device here, this means either your ADB is not running, or your device is not recognized by your computer
also verify you have debug mode enabled in your device
Do you have the usb debug driver for you device installed? This is the driver that allows your device to "comunicate"with eclipse in order to debug

My phone cannot be detected in eclipse to test run

Before asking my question, I have looked through a few threads that share the same problem as me and have tried all the given solution with no success. I am from Malaysia.
I cannot get my device to be detected to test my app on my phone. I have checked both the "Unknown sources" and "USB debugging" settings in my phone. I am using eclipse. But if I create a random virtual device, my app is able to run there.
Okay so I am using a Motorola Atrix 2. And I'm using Windows 8 Pro 64 bit
I have downloaded android SDK bundle from here : http://www.motorola.com/sites/motodev/us-en/motodev_lp.html
I have also tried downloading the latest driver with no success. I have also added this line in the manifest android:debuggable="true"
I have tried both as a mass storage device and a media transferring device.
I would appreciate any help a lot because as of now, I cannot progress further into developing an android app and that saddens me. :(
I have attached a picture of which my android phone should be detected in the window, but as you can see, none.
https://pbs.twimg.com/media/BJu1XSgCYAEGCUd.jpg:large
go to /your-android-sdk-directory/platform-tools using command prompt.
type
adb kill-server
adb start-server
adb devices
n see whether ur device is detected now or not...
Note: if you're using a Linux machine then put ./ before adb
Install proper drivers for your adb devices, from Android-SDK archive or Motorola site.
If you are on Windows machine, go to the device manager find your device, and select folder with drivers for it.
Open you windows os's explorer, have a look at the process, if there two or more process hold your adb, try to exits the process
Check that the android:minSdkVersion is lower or equal to the Version running on the phone. If it is higher it wont show on "Android Device Chooser"
Install and run programs/drivers with admin rights.
Have you installed Motorola Device Manager?
When debugging Samsung and HTC devices I got it to work by installing that kind of software (for syncing the devices to the computer).
Download from the following: ABD Universal Driver
and install it. Make sure you have your device plugged in before installing and make sure you are on USB debug mode on the phone settings.

Categories

Resources