The selected Device is Incompatible - android

I debug the app using my phone (not emulator) and the error pops up, as shown in attached photo below.
minSdk(API 19) > deviceSdk(API 1)

I have a device that uses Android 4.4.2 (API 19). It gave the same strange conflict stating the minimum was API 16 and it conflicted with an API 1 device.
This is what I did and it worked after some time. I'm not sure of the order (or the significance) of each step.
Verify that the "Android SDK Manager" had both "API 19 SDK Build-tools" and "Android 4.4.2 (API 19)" packages installed.
Set the /etc/usb/rules.d/51-android.rules has to be set by using running lsusb
and then entering the first four digits in the XXXX:XXXX pair of your device.
See the following answer for help
https://stackoverflow.com/a/28724457/149162
In the terminal, run adb kill-server then adb start-server.
After this, in the "Device Chooser" window, my device read that it was [UNDOCUMENTED] instead of [OFFLINE], but it was still incompatible and the OK button was disabled.
Plug the device in using a USB cord. Go into Settings/Developer options. (Turn on developer options, if showing. If not showing, turn on by tapping Settings/About Phone/Build number 7 times.) In "Developer options" tap "USB debugging". Device dialog box "Allow USB debugging?" will ask you to confirm your computer's RSA fingerprint. Make sure you check the option "Always allow from this computer" and tap OK button.
Run and check your "Device Chooser" dialog again. It should change from [OFFLINE] or whatever it was to the device's name with spelled out Android version and API. State field will change to "Online" and Compatible field will change to "Yes".

If you are getting this error using an emulator, not a physical device, I have also found that terminating adb.exe from task manager and then starting up the AVD again fixes this problem.

this error The selected device is incompatible means that your phone has an API that your app can't support. To resolve it, go in the SDK Manager and download the sources corresponding to your device API.
Then go in the build.gradle file, and verify that at minSdk there is written the oldest you have downloaded.
It's just strange that the APi of your phone is declared as API 1, but try to find the real API and download the sources for it.

I was also having the exact problem. Here are the steps to resolve it.
Make sure you have adb.exe in your PATH. For windows system you can find it here: C:\Users\<User Name>\AppData\Local\Android\sdk\platform-tools\
From terminal or command Prompt run adb kill-server
Now just hit the play button to start the app.

I had this exact same problem with my Nexus 5x. I believe it's related to the USB type-C cable. I took the suggestion of the accepted answer and plugged the cable into a usb hub and then into my machine and it worked perfectly.

Please do the following
Click File>ProjectStructure> Select Flavour from the panel set Min Sdk version 1

if anyone else is getting an issue with this you can check your SDK Manager and ensure that the build tools for your specific API version is installed. If it's not installed then install it and should solve the problem.

This is because you minSdkVersion of you application is heigher than that in you phone.you can fix the minSdkVersion of you application to solve this problem.

Usually whenever I connect the android device for usb debugging, the device will prompt me asking for providing permission to enable usb debugging.
In my case, for some reason, I didnt get this prompt and hence, I got this error. I have turned off developer options & USB debugging, turned on again. Then, I got the prompt and the issue is solved

I faced the same problem a few days ago and I solved it by using following steps:
Instead of using the Device Chooser dialog, you have to deploy it directly. Steps to fix the issue:
Open the Run/Debug configurations dialog.
Select your app configuration from the tree on the left.
In the General tab, locate the Target Device group box or the drop down menu( in android studio 1.5.1) and select the USB Device radio button.
When you run the app it will not display the Device Chooser dialog, it will deploy the app directly on the connected android device directly.

However it is strange, the message "device is incompatible" could appear also due to the lack of the authorization of the USB connection on the device. I had it just now.

After setting up developer mode, and ticking the allow USB on my phone. I ran Android studio and got API1 incompatible. I looked at my phone Huawei Y3, which was waiting for a response, "will you allow device with mac address blah to connect to your phone?". Problem solved.

I got the same problem when I switched Samsung 10" pads with a friend. Under Windows 10, I went into the DOS Command Prompt, changed to the folder containing the adb.exe file which was C:\Users\\AppData\Local\Android\sdk\platform-tools, and entered the 'adb kill-server' command as described above. When I went back into Android Studio and selected shift-F9 (Debug App). ADB restarted and recognized the new pad as compatible. ADB seems to have problems switching between devices. Interestingly, boths pads had identical Android component builds.

I was using my old mobile usb cable. When I replaced the cable with the new mobile one, and adb kill-server, I was able to connect my device. I couldn't believe it.

Let your device be connected
Disable USB debugging
Enable USB debugging
Run config choose the device.

Related

Nexus 5X not identified correctly in Android Studio

I'm (very) new to Android development, and am trying to test my app on my Nexus 5X. I've previously done it successfully, on the same 5X, with the same version of Android Studio on the same computer, so I'm not sure what's changed.
With the phone connected via USB to my laptop running Linux Mint (18.1), in the 'Select Deployment Target' screen in Android Studio (v2.3.1) under 'Connected Devices', I see a single entry:
00b9xxxxxxxxcb26 [null]
(that's a full ID, but I'm not sure how sensitive it is as a value, so am being conservative).
I'm sure previously here it said "Nexus 5X" or something similar.
If I try to deploy to that device it fails, with an error saying:
Session 'mobile': Error Installing APK
No message appears on the phone, which definitely has USB Debugging enabled.
There's nothing in the Android Monitor tab, and the Event Log just shows:
21:42 Executing tasks: [:mobile:assembleDebug]
21:42 Gradle build finished in 661ms
21:42 Session 'mobile': Error Installing APK
I've tried updating Android Studio (I was previously on 2.3, and the same happened), restarting the phone and Android Studio. The app runs successfully in a Nexus 5X emulator.
I can't think of any other useful information that might be relevant, except that I'm connected USB-C to USB-C, but I'm pretty sure that was how I connected the phone before, I can try USB-A to USB-C tomorrow, but don't have that cable available right now. Any other thoughts?
Possible solutions:
disable USB debugging and re-enable it again
check the cable - if it's not the cable, connect the phone directly to the computer, without using any hub or anything
stop adb deamon: adb kill-server, and then remove the .android directory in your home directory - this will remove the debug keys *
removing your debug keys and restarting adb should make appear a confirmation dialog on your android device when you connect it
Adding a new answer, because although Adam Szewera and A. Petrizza's answers helped get me there, neither of them quite includes the key problem.
That was that I'd changed the 'Use USB to...' option, which appears as a notification when you plug the phone in to a computer to 'Charge this device'. Changing it to 'Transfer files' immediately fixed the problem, and now I see "LGE Nexus 5X ..." in Android Studio, and can deploy to it as before.
Thanks both for your pointers which got me thinking straight :)
Plan A.
You need to make sure the cord that is plugged into the computer is used for data transfer and not just for charging your device!
Go to your phone's settings and make sure that the developer settings are turned on (my phone tends to turn this off randomly sometimes).
If all else fails try the good ole' phone off and back on again.
Plan B.
go to Run
Click on Edit Configurations
Select the project
find the Target Device section under the General tab on the Android Application page.

Android Studio Stuck on "Installing APK"

Android Studio no longer seems to be detecting when an app has installed on a target device and opened. It gets stuck on "Installing APK" and the progress bar is empty. There are no errors, the apk successfully installs and opens, it's just the IDE is still showing "Installing APK" and it does not automatically connect the debugger. I can manually connect the debugger using the "Attach debugger to Android process button", but this is not ideal.
Can anyone offer any suggestions for what's up and how to resolve it?
It turns out the problem wasn't with Android Studio, but with the device I was using for testing. I tried a different device and it behaved normally, progressing beyond "Installing APK" and stopping on breakpoints.
Somehow the "wait for debugger" setting in developer options on the problem device had switched to off. I switched this back on and now this device is behaving normally.
-Note that I had to choose an arbitrary debug app for the setting to become active. Once I'd set it on, I deselected the debug app and the setting remained on, as I left it. This was a HUAWEI P8 running android 6.0 API Level 23.
Recently, I was facing the same issue when I have updated My Device (MI A1) OS from Android Oreo(8.0) to Android Pie(9.0),
Solution: Go to the Settings > Developer options > Now click on > Revoke USB debugging authorisations.
It will disable/remove developer options from your device, Now restart your device once and then you just need to re-enable your developer options and that all you need to do, Enjoy Developing on Pie.
Hope this will help you as well.. :)
I found a solution that works for me. In Developer Options turn off "Monitor apps installed by ADB".
Just reboot your phone (:
It happens after update android version.
On my HTC One I unchecked “Verify apps over USB” in Settings -> Developer Options.
I had this same problem. I solved it by revoking USB Debugging Authorizations and then re-enabling USB Debugging on my chosen device(s).
Edit: Cleaning my project also helped with solving this problem.
for me it was something magic
I solve it by removing the USB from the Laptop and from mobile too(type-c cable) and
turning off the debugging mode and again turn it on
and then I connect it back to my Laptop and selected the same FILE TRANSFER MODE
then run the app and it get installed to my device and work as expected
Hope you will find Useful to
I have this problem recently on my Pixel 2 testing device, latest factory image with Android Studio 3.4, on windows 10.
I have tried all methods mentioned but none of them work. It cost me more than 6 hours to figure it out.
My problem is the USB driver, I am not using the "perfect" USB driver. My driver works in most scenarios and commands but not in every scenario.
You do not need Android Studio to dig into this problem, just using adb.
Please try if you can install apk from adb using following command:
adb install xxxx.apk
If it stuck at "performing streamed install" but never finish, this is the problem.
Please try push a big file(more than 5MB) to your device:
adb push xxxx.apk /storage/emulated/0
In my testing, it stuck at 13%, 16%, etc, but never go on. It seems cannot transfer large files. This is why the installation is pending in my case.
I update the driver to another one, and the problem is fixed. Hope it can solve your problem, too.
I had the exact same problem.
what's more, i can not adb shell and adb push files.
I am running an Ubuntu 18.04 VM and test on xiaomi phone 8,9.
The problem for me was the USB Compatibility setting for the VM was set to 2.0, it needs to be at least 3.0. To change the setting power down the VM and choose the "Edit virtual machine settings" in the VMPlayer startup menu. Then select the "USB Controller" device and change "USB Compatibility" to USB 3.0.
Hope this can help u!
It doesn't hurt to verify your USB port. In my case it was the faulty USB port which I had to switch to the mobo's one instead of the case port.
Restarting Android studio worked for me
I tried rebooting my phone and it worked.
When attach my mobile to my PC, the follow menu is showed. I Clicke on it.
In the next section, I had changed from "USB connection" to "Transfer files"
After that adb install works for me.
In my case, Second Space was created but not switched on. I had to delete the second space and everything worked just fine.
My settings are:
Usb debugging -> ON
Install via Usb -> ON
Verify over USB -> ON
Wait for debugger -> ON
Device: Redmi Note 5 Pro
I had this issue with an emulator on Linux. After trying pretty much every solution and suggestion on this page, what made it work for me was turning off Instant Run.
In my case i did not make sure that my android studio DSK manager was up to date with the android version that my device was operating on. So when running flutter doctor all seemed well, and i had the latest android version and all on android studio, but as mentioned it was not matching the version for my device i had connected.
Once i added the correct android version (in my case android 6.0) with SDK manager using android studio, it did not get stuck at installing apk.
My case was similar but for Android Version 10 required having the Verify bytecode of debuggable apps to off.
Final settings were:
USB debugging -> ON
Wait for debugger -> ON
Verify apps over USB -> ON
Verify bytecode of debuggable apps -> OFF
Device: Pixel XL
For me, the top answer "wait for debugger" was completely greyed out.
What worked for me was to look inside "Apps" and I noticed the app was uninstalled, but only for my current user. Clicking uninstall for all users unblocked the installation via Android Studio again.
Check following in your project
build-gradle plugin version in project level build.gradle file
gradle version in gradle-wrapper.properties file
buildToolsVersion
uninstalling the previous installed app worked for me
Turn off Verify apps over USB and Verify bytecode for debuggable apps (might not be available for all devices) in your Developer settings menu. The install time will decrease drastically.
I'm using Visual Studio Xamarin and the issue was caused by the missing CPU architecture. After checking them, the APK became installable via adb install ...
Just reboot your mobile . If not working try reboot your Android studio and mobile.

Android Studio doesn't recognize my device

Here is the problem. I want to run my Android Studio apps on my device (Samsung Galaxy Ace 2). But nothing works for me. Tell me what I've missed:
1) USB debugging is on
2) ADB driver is installed (in device manager i can see Android Composite ADB Interface)
3) ADB device list is still clear, even if i reset server(adb kill-server, adb start-server, adb devices - list of devices is clear)
4) in google usb driver directory, in android_winusb.inf file I added my device identificators
5) Android device manager still cannot connect to my device, showing this error when I reset it: "adb connection error an existing connection was forcibly closed by the remote host"
So I will be glad to hear any advices. Hope you'll help me
Did you try to configure the "Media Mode" in "Camera (PTP)" instead of "Media device (MTP)"? This is sometimes solving the issue. Its in the USB Computer Connection options of your Android device, you should see an "authorize" dialog then.
Update 04/2017: looks like it has been fixed in Android 7.1.2
I have done numerous ways of handling that issue. Finally it has worked! I am using LG Optimus II, but I believe the following steps are generic to other Android devices as well.
Step 1:
Make sure your device is enabled for development. If yes, go to Step 2, otherwise go to Settings > About phone and tap Build number seven times which is magic number :-).
Now Developer Options is available in the Settings.
Step 2:
Before you plug your device to PC, Go to Settings > Developer Options and select USB Connection method.
Step 3:
Plug the phone to the PC, you are given options for the USB Connection method, and please select Internet connection. Make sure you have connected to the Internet. By the way, I have changed MTP to PTP, it did not work for me. Therefore, I tried Internet connection mode, then it worked.
Step 4:
Run the app in the Android Studio, it will ask you to authorize the device for development, and select YES!.
Step 5:
Run the application via Android Studio and choose the device, not emulator, and BINGO! Welcome to Android development board.
Try swapping the USB port the cable is plugged into.
Sounds crazy but after 20 minutes of debugging this worked for me.
I also tried above solutions but got no luck. So here's what I did:
Download and install PdaNet+ to fix connection issues between my computer and android device
Enable USB debugging on my android device
Unplug the phone and plug it again after it's installed
Run my app and voila! My android device is now recognized by Android Studio
Although my computer could recognise my phone, I had to install the official drivers from the Samsung developer site to get adb/Android Studio to recognise it:
Samsung Android USB Driver for Windows
Click Revoke USB debugging authorization in Developer option and try it again.
Solution for those working with Huawei phones - You will get this error when ADB interface is not installed. Check if you have installed Huawei HiSuite. USB driver gets installed when you install HiSuite (I suppose this is true for most of the new phones that come with a Sync Software). If the ADB interface is installed on your computer you should see 'Android Composite ADB Interface' under Android Phone in your Device Manager as shown in this picture.
If you have Mi Device than you need to enable this two option after enabling Developer Mode.
USB Debugging (Enable = True)
Install via USB (Enable = True)
See this screenshot.
LG Optimus Zone 2 pp415 d\n connect in mtp, but does work in internet connection mode. Lost lots of time messing with it. There's no doc for this, but I'd suggest trying all 4 of the connection options. Only 1 that works for me is Internet Connection->Ethernet, then win 8 auto-detects a driver and installs it. In MTP mode despite all drivers being registered with device manager, adb doesn't pick it up.
I had the same problem. So here is what i did
reinstalled the device driver
changed the USB computer connection from MTP to Mass storage(UMS)
And it worked.
For me, I tried the above. Turns out my USB cable was bad. I changed the cable and then it worked.
I am sorry that i bothered you all. The problem was my device is cloned in different places in device manager. It was gone when I tried to update driver for my phone in "Other devices" list, and before i have been updating it in wrong sections. Thank you all.
In my case it was due to already running and hanged adb.exe on another user under my PC. I had two users on my PC, the second user had the adb.exe process hanged even when I tried to end the process. It worked with me after (End Process Tree) from the Task Manager.
Hope this will help someone with multiple users :)
Ahmad
In addition to the above configurations, I had to set deployment target to "Open Select Deployment Target Dialog", run once (choosing my device from the options listed), and from then on Android Studio was able to see my device even after changing the deployment setting back to "USB Device". My SWAG is that since Android Studio uses its own internal cache to find your device, it has to be initialized first.
I was on Samsung S8 and had same problem too. After I installed Samsung Kies, issues was resolved for me, as I believe it had updated the correct driver required for my Samsung S8.
On Windows 7 , the only thing that worked for me is this. Go to Device Manager -> Under Android Phone -> Right Click and select 'enable'
i had to install android studio in 2 machines and ive solved this problem intalling samnsung kies, i use 3 diferents samnsung devices (plus some other of my family and friends) and i dont have to strugle with the drivers, it works for me and i recomend it. hope it helps
For me, this ended up being because I had the wrong SDK level installed (new version of Android Studio installed the SDK for Android 10, whereas I have a device that runs only Android 8.1). While Android Studio would "recognize" the device and display a string in the "devices" menu instead of just saying that no device was connected, installing the right SDK level for my device ended up changing the string to something recognizable (my device's model name) and allowed me to actually run my app over ADB.
I had a big problem with my Samsung S10 Plus as it was not detecded by Android Studio on my Macbook even if I did all what is required to be detected, that is to say:
Enable developer mode (7 taps on Build version in Android settings)
Enable USB debugging
What I did is to start "Android File Transfer" on my Macbook and the magic happened. A popup appeared on my device asking if I want to authorize an USB access to it. I clicked "Yes, always" and now Android Studio can detect my device on my Mac :)
Change the connection method Build-In CD ROM it works for me
On HTC mini one 2, besides enabling the Developer Options, the following worked for me:
Go to More in Wireless & Networks
Mobile Network Sharing
In USB network setting
Select Internet pass-through

How can I get Eclipse to recognize my Nexus 7?

This is the process I have gone through:
I downloaded the USB driver through Eclipse.
Then I went into the developer options on my Nexus, and I turned on USB debugging as well as the mock locations option, and then changed the debugging option to true in my main.xml.
After this I went and changed the connection to PTP.
I then connected my device and allowed it to install the drivers it needed to recognize itself in device manager.
I went into device manager and find my device listed as a camera and update the driver so that it now lists my device as an Android Composite ADB Interface. This is where I am having trouble.
Even though it is listed as such in my device manager, I am still unable to discover it in Eclipse. I think it may have something to do with the fact that it is still being listed as a camera as well as an Android device in device manager.
I've tried uninstalling both drivers for the device and then installing it again, but to no avail. I've also tried resetting adb in Eclipse and in command prompt and that didn't work either. I would try and remove the drivers for the device off my computer, but I don't know where to find them.
Can anyone give me any ideas?
download the usb driver from http://www.asus.com/Tablets_Mobile/Nexus_7/#support_Download_32 , then install it in device manager. Dont forget to tick the "debugging mode" (in developer option).
my nexus 7 will prompt me whether want to allow to be accessed or not, just ok and all will be fined.
Wow, so this took a while but I finally got it working. I removed SDK from my computer with all of the installments, and then installed it again in a different location. Somehow this worked.
for me after i went to settings--->About Phone---> and then clicked on "Build number" at least 5 to 7 times to enable developer mode i had this issue. Turns out i didn't realize that after enable developer options this only makes the option APPEAR IN YOUR ANDROID AS IN PREVIOUS VERSIONS. I then went back into settings and found developer options and checked off use for debugging etc and it worked as i ran "adb devices" at command prompt and it shows up

why eclipse can not detect android device?

Eclipse can't detect my android device but it can run with the emulator. i have no problem with the android device setting since it work well in my old laptop.
any idea?
When you start the Device sometimes adb doesn't recognize it because it has already started. So, in that case you just need to reset adb from DDMS->Devices
Go to android-sdk/platform-tools/ via command promt...
write command.. adb devices (It will show the list of attached devices)
If its not display device number then look at the drivers of device on your system. And if display then just restart eclipse..
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"
Also, after installing the usb drivers you may need to set your Android device to developer mode and enable USB debugging on your device before it will be seen by adb or eclipse. From http://developer.android.com/tools/device.html
2.Enable USB debugging on your device. ◦On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development.
On Android 4.0 and newer, it's in Settings > Developer options.
Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
In my case, i ran adb-devices and it did show my device and it was unauthorized on the PC I was using.
I went to developer tools and disabled and then enabled USB debugging. It then prompted me for authorization for that computer, and then it worked fine.
Hope this helps someone.
Try connecting using the command prompt ./adb connect 192.168.xxx.xxx:5555
If you are running Linux you will have to add your device to the /etc/udev/rules.d/51-android.rules file.
Have a look here: http://developer.android.com/tools/device.html . Its a document on using hardware devices.
haven't you enable 'debug mode' in your Android device?
If not, then please enable it first. Then follow the steps in this article.
This example use Lenovo P770 as a device.
http://www.mywordismyopinion.com/2014/02/experience-using-smartphone-lenovo-p770.html
-hope this is helpful, :).
just install any driver are any compatibility software provided by your device provider like Samsung provide kies,Htc provide Sync etc..
Either check check your sysytem or antivirus not block it.

Categories

Resources