Android Studio recognizes physical Device as Null?
Android StudioAdbAndroid Studio Problem Overview
I've been developing an Android Application for Android
(SDK min version 14) and I have testing it normally with tablets such as Samsung Galaxy 2 and Nexus 7
.
However when I tried to run the application (by clicking run in AndroidStudio
), AS does not recognise the tablet information, which is shown in the picture below.
The interesting thing is that as shown in the picture above, AS is also detecting the device sdk as API 1
when it's Android version is 4.2.2
The tablet is already set to accept "USB debugging
" in the developer options, I'have tried rebooting the tablet, and restarting AS, but still I get the same problem(everything is fine with nexus 7 and Samsung Galaxy 2
).
The tablet/device I'm working on is a "VeryKool" T742
Environment information:
OS: ubuntu
AndroidStudio version: 0.8.6
Tablet Android version:4.2.2
Tablet Kernel version: 3.4.5
App min SDK: 14
Android Studio Solutions
Solution 1 - Android Studio
Ok So I finally found the problem, apparently on this device you have to set to connect as camera(even after usb debugging is already enabled)
Also this link describes the setting up process
Solution 2 - Android Studio
I've seen this error a few times when adb hasn't been connected with correct permissions.
On the terminal try
~/Android/Sdk/platform-tools> ./adb devices
if it returns
<deviceIdentifier> no permissions
then you need to restart adb with correct perms
~/Android/Sdk/platform-tools$> ./adb kill-server
~/Android/Sdk/platform-tools$> sudo ./adb devices
if that worked then you'll get
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
<deviceIdentifier> device
No more Sdk version resolution issues in Android Studio after that.
Solution 3 - Android Studio
Just run this command after you connect your device to your Ubuntu system:
adb devices
This works for me.
Note: Make sure you have selected file transfer option in your phone.
Solution 4 - Android Studio
On Ubuntu, with my Pixel XL on 8.0, I had to do this while plugged into computer:
Settings -> Connected Devices -> USB --> Change to 'Transferring Files'
Solution 5 - Android Studio
Have the same problem with my Nexus 5/5X/Pixel 2 XL on Ubuntu 18.04.
A permanent solution is to add a udev rule so that you can always access the device.
-
Find your device with the command
lsusb
. This outputs e.g. for my Pixel 2 XL this:Bus 001 Device 003: ID 18d1:4ee7 Google Inc. # This means: BUS=001, DEVICE=003, VENDOR=18d1, PRODUCT=4ee7
-
Now check the permissions. Replace 001 and 003 with your parameters:
ls -l /dev/bus/usb/001/008 # Output: crw-rw-r-T 1 root root 189, 8 Nov 10 18:34 /dev/bus/usb/001/003 # Unless you are root, you are missing the permissions to access the device
-
To fix this, create a udev rule file with
sudo nano /etc/udev/rules.d/51-android.rules
with the following content:SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0660", GROUP="plugdev", SYMLINK+="android%n" # You need to replace "18d1" and "4ee7" with your output of `lsusb` above
-
Unplug and plug you device back in. It should now always be recognized. If not, restart the adb server a last time with
adb kill-server
.
Source: http://www.janosgyerik.com/adding-udev-rules-for-usb-debugging-android-devices/
Solution 6 - Android Studio
Ran into the same problem while using Android Studio on Ubuntu. Apparently for me the fix was to set the USB connection mode for the device as MTP.
Solution 7 - Android Studio
First check adb version:If it gives Output like
Android Debug Bridge version 1.0.32
Then just restart the daemon.
sudo adb kill-server
sudo adb start-server
else install adb first and restart the daemon Worked for me, in ubuntu 16.04.3
Solution 8 - Android Studio
Recently, I was facing the same issue for Vivo and MI phones. I have tried everything described in this thread. I tried connecting as MTP, PTP; But nothing worked.
After many retries I found a solution for my case and may be it can help others too.
- Open terminal window in Android Studio
- Kill ADB server using following command:
adb kill-server
- Restart ADB server using following command:
adb start-server
It solved my issue.
Solution 9 - Android Studio
Disabling and re-enabling debugging while the device was connected did the trick for me.
Solution 10 - Android Studio
I had the same problem.
I solved it by opening my Android device Settings, then selecting "Turn off" then "Turn on" for USB Debugging.
Solution 11 - Android Studio
I had the same problem. I resolved this by doing
- Android -> SDk -> platform tool
2.Open terminal for(ubuntu user) or open cmd(window user)
3.type command "sudo adb kill-server"
4.Go to android studio,then reconnect the device.
Solution 12 - Android Studio
On ubuntu installing adb worked for me, I think there was some problem with default android studio one .
In terminal use command
sudo apt install adb
Solution 13 - Android Studio
Sometimes in Linux (Centos 6 in my case) the reason can be that you didn't started Android Studio as the root user. please restart android studio as the root user and try it!
Solution 14 - Android Studio
For ubuntu machine select the transfer option and device will detected in android studio as well as for debugging. Generally device is at charging state for windows but for ubuntu this is how it works.
Also many a times device is not detected , do the same thing again.
Solution 15 - Android Studio
Needed MTP mode, but it does not come up under the USB side. In the storage setting on the menu bar item you get to set the PC connection type as ... MTP.
Solution 16 - Android Studio
check processes running, i had several adb processes running and i think this was screwing things up for me. Kill them all then restart Studio. HTC Sync Manager, GenyMotion etc and possibly when you have multiple Android Studio windows open can result in multiple conflicting adb processes.
Solution 17 - Android Studio
On Ubuntu especially or any other platform. Please and Please Check your adb version. I can't stress this enough. ensure it is updated or the lastest version especially if the above answers doesn't work and this link also does not work.
After I updated my platform-tools folder located at
PATH_TO/Android/Sdk/platform-tools
which also contains the adb
it worked.
I ran
adb devices
first it would show unauthorized then
you unplug and re-plug the android device. Then your phone would ask for permission before the system would read your device.
Solution 18 - Android Studio
In my case, simply looking at my phone and ticking the pop-up checkbox to allow USB debugging did the job for me.
Solution 19 - Android Studio
Go to terminal in android studio and run "adb devices". It will show the connected devices. Then Run the app and the device should show up.