可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I have just set up android studio and am trying to compile my first project. The project gets compiled but when the 'Choose Device' menu opens the device and state is shown as [OFFLINE] and compatible gives message Android error message Android error 'No, minSdk(API 19) > deviceSdk(API 1)' What does this mean? How can I solve it?
my build.grandle file looks like this apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.yaron.myapplication" minSdkVersion 19 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' }
回答1:
There are a few things to check.
if you go to the terminal window in Android Studio and cd to the path where your sdk platform tools are installed (something like C:\Android\SDK\platform-tools ) and run the following command
adb devices
Do you have a device listed? If not then you don't have the device setup properly, or the correct drivers.
On the phone make sure that you have developer options enabled (go to settings->about phone and click on the Build Number 7 times or so)
Once you have enabled that go into the develop options under settings and make sure USB debugging is enabled.
If adb devices said "no permission" for the device you are connecting, make sure to connect it as MTP device first. This will implicitly prompt you to import the computer's fingerprint and allow future connections for USB debugging as well.
回答2:
ADB Secure device authorizations are stored in a white-list located in the adb directory. if you want to connect to the ADB daemon running on the android device from a process running on the device via tcp as localhost then the connection is successful but the Authorisation prompt is not displayed and the device is shown as Offline.
You need to have root access in order to remove RSA keys from the white-list. When the pop up "Allow USB Debugging" comes on the phone screen, press "Ok" to enable it. if not unplug and re-plug to see the prompt.
回答3:
Same problem with a tablet with Android 4.4.2, in my case solved enabling MTP: Settings-> Storage-> Three dots on top right->USB computer connection->Emable "Media device (MTP)"
Of course, debugging was already enabled.
回答4:
In build.gradle file, change the minSdkVersion to 7
回答5:
Got same error 'Compatible No, minSdk(API 19) > deviceSdk(API 1)' in Android Studio Device Chooser for Samsung Tablet with Android 4.4.2. The below simple steps resolved the issue for me: Disconnect the USB debug cable
Open Developer Options in Settings on the device
Click Revoke USB debugging authorizations
Click OK to 'USB debugging access will be revoked from all the computers you have previously authorized'
Reconnect over USB and accept the new 'Allow USB debugging' authorization for this computer
Start a new debugging session
回答6:
The issue is with build tools version that you are using.
Please try the following:
Android Studio=>Open your project=>File=>Project Structure=>app(i.e left pannel)=>Properties=>Build Tools Version=>
Select 19.1.0.
It worked fine for me..Just try it out :)
回答7:
This most likely means that you have not allowed USB debugging. When you connect your device to your computer, your device should prompt you to "Allow USB debugging?" Just hit OK to enable it.
回答8:
the storage space of my smartphone was full. After cleaning up I was able to use it and the device was "compatible".
回答9:
Change the minSdkVersion to your target device sdkVersion in build.gradle(Module:app) file will be appear on left side in Gradle Scripts.
Ex: minSdkVersion 24
Change the version value to your target device value (23, 22, 21 or other)
According to your configuration you have to change the minSdkVersion 19 to minSdkVersion 1, because your target device is at API Level 1.
回答10:
I had this problem on a VirtualBox Linux (Ubuntu 15.10 guest on a 14.04 host). adb devices showed unauthorized.
In this case, this was fixed by adding a /etc/udev/rules.d/51-android.rules with the proper rule on the guest and clearing all previous authorizations under developer options on the Android device. (Was set previously to the same computer as the device was rooted for CyanogenMod.)
回答11:
You have to set to connect as camera(even after usb debugging is already enabled)
回答12:
I had this same problem. My resolution in Android Studio was to set check on:
Tools -> Android -> Enable ADB Integration
回答13:
Unplug and re-plug to see if the prompt appears and click on allow. Of course, USB debugging must be enabled from developer options. And the mobile's driver must be installed on the pc (if on windows).
回答14:
I met this problem just now,and I solve it by enable developer mode from setting of my mobile phone .and it works.
回答15:
This problem went away when I disabled and re-enabled USB debugging in my Android device's Developer Options settings.
回答16:
In the bundle.gradle(Module: app) change minSdkVersion 19 from 19 to 1. This fixed my probem
回答17:
****I resolve my this error by installing new android device with API 19 and than runs fine.....
回答18:
On your file build.gradle you need to add the correct API of your deviceSdk.
minSdkVersion 1
minSdk(API 19) > deviceSdk(API 1)
i am using USB and my Connected Device