Eclipse 与 Android 没有响应
我已经安装了 Eclipse 和 Android SDK,但我无法让一切正常工作。两天后,我成功创建了一个可以正常工作的模拟器,它实际上显示了 Android 界面(而不是带有 Android 文本的黑屏),但我完全不知道为什么它在前两天不起作用。之后,我在 ADB 方面遇到了问题,我也设法解决了这个问题。但我的问题还没有结束。我现在在将示例 APK 文件安装到模拟器中时遇到问题,但没有收到任何错误消息,这使得很难找到解决方案。
即我已经加载了 2 个不同的项目(bbbb 和 Snake),按下运行后模拟器启动。但然后什么也没有发生。我复制粘贴了下面的控制台的一个版本。
[2011-10-21 20:29:59 - bbbb] WARNING: Application does not specify an API level requirement!
[2011-10-21 20:29:59 - bbbb] Device API version is 14 (Android 4.0.1)
[2011-10-21 20:29:59 - bbbb] Uploading bbbb.apk onto device 'emulator-5554'
[2011-10-21 20:29:59 - bbbb] Installing bbbb.apk...
[2011-10-21 20:59:28 - Snake] ------------------------------
[2011-10-21 20:59:28 - Snake] Android Launch!
[2011-10-21 20:59:28 - Snake] adb is running normally.
[2011-10-21 20:59:28 - Snake] Performing com.example.android.snake.Snake activity launch
[2011-10-21 20:59:31 - Snake] WARNING: Application does not specify an API level requirement!
[2011-10-21 20:59:31 - Snake] Device API version is 14 (Android 4.0.1)
[2011-10-21 20:59:31 - Snake] Uploading Snake.apk onto device 'emulator-5554'
[2011-10-21 20:59:31 - Snake] Installing Snake.apk...
正如您所看到的,控制台在 Installing .apk... 行之后停止(是的,我已经等了 30 分钟才能确定)。为什么我没有收到超时或错误消息? 我现在真的不知道该怎么办。我在网上找不到任何关于此问题的答案。任何人都可以帮助我吗?我真的想开始一些实际的编程而不是这个。我使用的是 Windows 7。
I've installed Eclipse and the Android SDK but I just cant get to everything working properly. After 2 days I managed to create a working emulator that actually shows am Android interface (instead of a black screen with Android text), but I have absolutely no idea why it didnt work for the first two days. After that, I´ve had problems with the ADB and I also managed to fix that. And still my problems aren't over. I now have a problem with installing the sample APK files into my emulator, but I dont get any error messages, which makes it really hard to find a solution for.
I.e. I've loaded 2 different projects (bbbb and Snake) and after pressing run the emulator starts up. BUt then, nothing happens. I have copy-pasted an exert of the console below.
[2011-10-21 20:29:59 - bbbb] WARNING: Application does not specify an API level requirement!
[2011-10-21 20:29:59 - bbbb] Device API version is 14 (Android 4.0.1)
[2011-10-21 20:29:59 - bbbb] Uploading bbbb.apk onto device 'emulator-5554'
[2011-10-21 20:29:59 - bbbb] Installing bbbb.apk...
[2011-10-21 20:59:28 - Snake] ------------------------------
[2011-10-21 20:59:28 - Snake] Android Launch!
[2011-10-21 20:59:28 - Snake] adb is running normally.
[2011-10-21 20:59:28 - Snake] Performing com.example.android.snake.Snake activity launch
[2011-10-21 20:59:31 - Snake] WARNING: Application does not specify an API level requirement!
[2011-10-21 20:59:31 - Snake] Device API version is 14 (Android 4.0.1)
[2011-10-21 20:59:31 - Snake] Uploading Snake.apk onto device 'emulator-5554'
[2011-10-21 20:59:31 - Snake] Installing Snake.apk...
As you can see, the console just stops after the Installing .apk... line (and yes I have waited for 30 minutes just to be sure). Why don't I get a time-out or error message?
I really dont know what to do now. And I cant find any answers on this on the web. Can anyone please help me. I really want to start some actual programming instead of this. I am using Windows 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的应用程序未指定 API 级别。转到窗口---->首选项,然后是 android。选择 API 级别。
Your app does not specify a API level. Go to Window ----> Preferences and then android. Pick a API level.
您应该尝试从使用 eclipse 创建新的 android 项目时创建的示例项目开始,而不是从 Snake.apk 开始。
或者,您可以使用 android 命令创建一个新项目,如下所示:
创建此项目后,使用版本 2.3 (android 9) 创建一个模拟器并尝试。
我不知道你是否应该乱用 android 14,但如果你根本不熟悉 android,因为还没有设备推出冰淇淋三明治,所以你要到下个月才能使用真实设备进行测试至少。
如果您计划针对蜂窝(平板电脑)设备,您可以从版本 13 开始并为此创建一个模拟器。顺便问一下,您的 PC 的规格如何?运行模拟器需要相当快的机器。 Android 模拟器是出了名的慢。
无论如何,我将从最基本的项目开始,这是 android 在您开始新项目时为您创建的模板项目。一旦成功,您就可以继续您自己的项目。
Instead of starting with Snake.apk, you should try starting with the example project that is created when you create a new android project with eclipse.
Alternatively you can create a new project with the android command like this:
After you've created this, make an emulator with version 2.3 (android 9) and try that.
I don't know if you should mess with android 14 yet if you aren't familiar with android at all given no device out yet has Ice cream sandwich yet so you won't be able to test with a real device until next month at least.
If you are planning to target honeycomb (tablet) devices you can start with version 13 and create an emulator for that. By the way, what are the specs like on your PC? It takes a pretty fast machine to run the emulator. The android emulator is notoriously slow.
Anyways, I'd start with the most basic of projects, which is the template project android creates for you when you start a new project.. Once that works you can continue with your own project.
使用 1.5 sdk 版本创建新的 AVD。
尝试从最低 sdk 版本(1.5)开始。并在创建项目时指定最低 sdk 版本。
还将模拟器皮肤设为qvga(最小)。
create new AVD with 1.5 sdk version.
Try to start with minimum sdk version(1.5).and specify your minimum sdk version while creating project.
also make the emulator skin as qvga(smallest).