简体   繁体   English

无法在Android Studio 0.8.1中模拟设备或将应用程序加载到手机中

[英]Cannot emulate a device or load app into phone in Android Studio 0.8.1

I'm using Android Studio 0.8.1 and after creating a new project (the basic "hello world"), I cannot get the program to load to my phone or emulate. 我使用的是Android Studio 0.8.1,创建新项目(基本的“ hello world”)后,无法将程序加载到手机或进行仿真。 I'm also at the beginner level of android development so keep that in mind. 我也是android开发的初学者,因此请记住这一点。

Steps: 脚步:

  1. Open Android Studio 开启Android Studio
  2. Select "New Project" 选择“新项目”
  3. Naming it "Test4" 将其命名为“ Test4”
  4. Setting Minimum SDK to "API 8:Android 2.2 (Froyo) 将最低SDK设置为“ API 8:Android 2.2(Froyo)
  5. Selecting "Blank Activity" 选择“空白活动”
  6. Click Finish. 单击完成。 --Project builds-- -项目建设-
  7. Click the run arrow. 单击运行箭头。
  8. In the "Choose Device" window, I see my HTC One M8 with Android 4.4.2(API19)as a running device, however the column labeled "Compatible" displays: "No, minSdk(API20, L preview!= deviceSdk(API19). 在“选择设备”窗口中,我看到装有Android 4.4.2(API19)的HTC One M8作为正在运行的设备,但是标有“兼容”的列显示:“否,minSdk(API20,L预览!= deviceSdk(API19 )。

Why is this the case when I selected API 8 as the minimum SDK? 当我选择API 8作为最低SDK时,为什么会这样?

image here: Compatibility Issue 图像在这里: 兼容性问题

Emulator attempt: 模拟器尝试:

When trying to use the emulator I seemed to have similar issues others have had, but the standard fixes don't seem to be working for me. 尝试使用仿真器时,我似乎也遇到了其他人遇到的类似问题,但是标准修复似乎不适用于我。

When I launch the emulator, There are no AVDs in the list so attempted to create one. 启动模拟器时,列表中没有AVD,因此尝试创建一个。 The Target pull down list only contains "Android L(Preview) - API Level L" The "CPU/ABI:" only displays "No system images installed for this target." “目标”下拉列表仅包含“ Android L(预览)-API级别L”。“ CPU / ABI:”仅显示“未为此目标安装系统映像”。 Using the Android SDK Manager, I installed all items for "Android L(API20, L preview), Android 4.4@(API20), Android 4.4.2(API19) except "glass Development Kit Preview." All Items under Android 2.2(API8). Installed Android SDK Build-tools from 19 to 23.0.2. Again, not sure about what needs to be installed. 我使用Android SDK Manager安装了“ Android L(API20,L预览),Android 4.4 @(API20),Android 4.4.2(API19),“ glass Development Kit预览”之外的所有项目。Android2.2(API8)下的所有项目)。从19到23.0.2安装了Android SDK Build-tools,同样,不确定是否需要安装什么。

If your ADT version is 23.0.2 and you have selected a blank activity then you will neither have any activity xml files created under the res/layout folder nor you will have the respective .java file created under the src folder. 如果您的ADT版本为23.0.2,并且选择了空白活动,则既不会在res / layout文件夹下创建任何活动xml文件,也不会在src文件夹下创建相应的.java文件。 So if you do not have a java file in the src folder it is obvious that your app cannot be installed on the Emulator. 因此,如果src文件夹中没有Java文件,则很明显您的应用程序无法安装在模拟器上。

This is a bug in this particular ADT version from Google I suppose. 我想这是来自Google的特定ADT版本中的错误。 And nothing to worry with your minSDK. 而您的minSDK也不用担心。

https://code.google.com/p/android/issues/detail?id=72419 https://code.google.com/p/android/issues/detail?id=72419

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM