Recognize Device Error In Android Studio
Table of Contents
1 Summay
Prolems about "No, minSDK(API 8)>deviceSDK(API1)" and "insufficient permissions for device"
Enviroment : Android Studio 1.4, Oracle Java version "1.7.0\80", ubuntu 14.04, HTC sensation with android 4.0.3
2 Problem
I met with a problem when I am learning Android develop currently. After creating the app, I want to run on my device. In the step: "Choosing a running device", the "Compatable" shows "No, minSDK(API 8)>deviceSDK(API1)".It seems my computer cannot recognize my android device. I tried lots of solutions found from google as belows:
- Restart Android Studio
- Disable and re-enable USB debugging on the phone
- Rebooting the phone or Restarting the phone while connected to PC
- Use a different USB cable
- Switched to a USB port that is NOT USB3.0
- Change jdk from openjdk to oracle jdk
- Restart adb It still doesn't work. But when I restart adb, it seems I find the problem,the adb shows: "insufficient permissions for device" .
3 Solution
Refer to Using Hardware Devices from android website http://developer.android.com/, I found the solution. Below is what I find at http://developer.android.com/.
3.1 Set up your system to detect your device
Log in as root and create this file:
/etc/udev/rules.d/51-android.rules
. Use this format to add each vendor to the file: ~SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"~In this example, the vendor ID is for HTC. The
MODE
assignment specifies read/write permissions, andGROUP
defines which Unix group owns the device node. Note: The rule syntax may vary slightly depending on your environment. Consult the udev documentation for your system as needed. For an overview of rule syntax, see this guide to writing udev rules.- Now execute:
chmod a+r /etc/udev/rules.d/51-android.rules
So just like it needs to install a USB driver for adb on Windows, on Ubuntu Linux, It need to add a udev rules file that contains a USB configuration for each type of device you want to use for development.
What a damn thing for freshman if not told this. :)