No android device found in unity

2020-02-01 02:21发布

问题:

When I am building a game for android, I get this message:

No Android device found! Make sure USB debugging has been enabled. Check your device. In most cases there should be a small icon in the status bar telling you if the USB connection is available. If you are sure that your device is attached then it might be your USB driver that's the problem. For details please check the Android SDK setup section in the Unity manual.

The cancel windows showed this error:

No android device found! If you are sure that your device is attached then it might be your USB driver that's the problem. For details please check the Android SDK setup section in the Unity manual.

The same error also appeared in the Console. How do I fix this error?

回答1:

Disconnect the USB cable from your android device, go to Settings > Developer Options and turn off and on the USB Debugging . Also tap on "Revoke USB Debugging Access". Now, connect the USB cable. When prompted tap "Yes".

If this doesn't help follow @Programmer answer.



回答2:

1. Install the driver for Android device on your computer.

2. Enable DEBUGGING in your Android device.

For Unity to be able to detect your Android device, it must be recognizable by the ADB program.

Open command prompt with cmd the change your directory to AndroidSDK\platform-tools with cd /d G:\AppDev\AndroidSDK\platform-tools .

Replace G:\AppDev\AndroidSDK\platform-tools with your android SDK location. then type adb devices. If no device is found then Unity wont' recognize it. Reboot your computer and try it again.

Once you see a device number, like in the picture below, then it will work in Unity.



回答3:

Make sure that you have "Charge only" in USB options - I had MTP enabled and the same error. After disabling MTP everything works fine.



回答4:

For all those who spent hours trying to find out what's wrong and none of above answers helped. Please also check if cable you are using is not cheap "charging only and no data transfer type".

I've picked up a random cable from my cable box. After trying everything and loosing x amount of hair and time, I've decided to check a different cable, and voila everything worked immediately.



回答5:

I had the same issue, it works for me

Check ARMv7

Unchek Android TV Compatibility



回答6:

Changing a USB cable worked for me. Ironically, from an expensive fancy one to a super-simple cheap one.



回答7:

Manually installing the drivers for your phone worked for me.

I did it through this link: https://developer.samsung.com/galaxy/others/android-usb-driver-for-windows. Even though it is a link from 2015, it worked perfectly fine with my Galaxy S8.



回答8:

if @Programmer or @kamran-bigdely solutions didn't work, then go to Edit > Project Settings > Editor, and change "Device" option to "Any Android Device". Best of Luck!