问题与“你好Android”教程 [英] Issue with 'Hello Android' tutorial

查看:106
本文介绍了问题与“你好Android”教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Eclipse和Android都是全新的,但对Java很熟悉。据说,我尝试使用最新的Eclipse(Galieo)和2.1 Android SDK从开发人员网站上遵循Hello Android教程,我在运行Snow Leopard(OS X 10.6)的Macintosh上。我有一个默认的虚拟设备(尽管我的目标实际上是像我自己的HTC Incredible这样的手机,它具有骁龙处理器,当然还有所有最新的智能手机)。



一切都好转,直到我去了 RUN> RUN ,然后选择Android应用程序。我的电脑旋转轮子一段时间,然后我看到两个错误。我已经粘贴了Eclipse的输出:

  [2010-05-04 01:53:46  -  HelloAndroid] --- --------------------------- 
[2010-05-04 01:53:46 - HelloAndroid] Android发布!
[2010-05-04 01:53:46 - HelloAndroid] adb正常运行。
[2010-05-04 01:53:46 - HelloAndroid]执行com.example.helloandroid.HelloAndroid活动启动
[2010-05-04 01:53:46 - HelloAndroid]自动目标模式:启动新的模拟器与兼容的AVD'myAVD'
[2010-05-04 01:53:46 - HelloAndroid]启动一个新的模拟器与虚拟设备'myAVD'
[2010-05-04 01:53 :58 - HelloAndroid]发现新的仿真器:emulator-5554
[2010-05-04 01:53:58 - HelloAndroid]等待HOME('android.process.acore')启动...
[2010-05-04 01:53:59 - 仿真器] 2010-05-04 01:53:59.501仿真器[10398:903]警告一次:此应用程序或其使用的库正在使用NSQuickDrawView,它具有已被弃用应用程式应停止使用QuickDraw并移至Quartz。
[2010-05-04 01:54:23 - HelloAndroid]模拟器-5554断开连接!取消'com.example.helloandroid.HelloAndroid活动启动'!

我从来没有看到模拟器中的文本,模拟器崩溃了一个关于它意外退出的消息。



崩溃报告指出:

 进程:模拟器[10472] 
路径:/应用程序/ android-sdk-mac_86 / tools / emulator
标识符:emulator
版本:??? (???)
代码类型:X86(Native)
父进程:eclipse [$]

日期/时间:2010-05-04 02:25:41.153 - 0500
操作系统版本:Mac OS X 10.6.3(10D573)
报告版本:6

自上次报告以来的间隔:2558914秒
自上次报告以来崩溃:4
自上次报告以来的每个应用程序崩溃:2
匿名UUID:C5F178C1-5290-4CA9-AD6E-E9C4F5582754

异常类型:EXC_BAD_ACCESS(SIGSEGV)
异常代码:KERN_INVALID_ADDRESS at 0x000000001fd2f000
崩溃线程:3

注意:从命令行运行模拟器与:

  iainnitro-Mac:工具iainnitro $ ./emulator -avd myAVD 

2010-05 -04 02:49:23.011仿真器[10556:903]警告一次:此应用程序或
使用的库正在使用已被弃用的NSQuickDrawView。应用程序应停止使用QuickDraw
并移至Quartz。
分段错误
iainnitro-Mac:工具iainnitro $

产生分段错误(如上所述,从终端输出)。所以仿真器在任何东西都可以显示之前就自行死亡。



我已经尝试重新启动ADB流程。



实际的代码是从教程一行一行,我从来没有能够到达XML部分。



我不知道我的错环境设置或者只是与雪豹不兼容?我非常感谢任何帮助解决这个问题,因为我非常希望在这个平台上开发。



谢谢你,



堪萨斯州的Mike N Lawrence

解决方案

没有直接的经验,但这似乎是一个复发的问题: >

此主题< a>建议:


你没有让模拟器一直启动。开始它,然后等到你看到桌面,就像在一个真正的手机。


这一个提到(我怀疑一点不是你的关心):



  1. 获取更多RAM。我运行在256 MB(我认为低于最低要求),今天升级到1024 MB(很久以前),应用程序现在开始正常。虽然我仍然在模拟器中看到一些错误消息,但似乎并没有做任何事情。


  2. 从命令行安装。这是一个有力的工作,但您可以从命令行启动一个模拟器(假设< android sdk path> \tools 添加到您的PATH变量)只需键入模拟器,然后浏览到 your_app_here.apk 的位置,然后执行





  adb install your_app_here.apk 




如果从Eclipse启动模拟器,执行 adb kill-service 然后 adb start-service first(或 kill-server / start-server ,不知道确切的命令)。那么你的应用程序将被安装在仿真器上。







另外(有点旧,但仍然可以相关


也许模拟器运行如此缓慢,adb服务器或其他组件(如DDMS)有点绝望,因为似乎正在等待模拟器将某些 HOME aplication。

但仿真器运行缓慢,Eclipse中的控制台发送消息: emulator-5554
已断开连接!取消'com.android.hello.HelloAndroid'启动!;
,仿真器继续正常运行并启动系统,但不要运行我构建的应用程序。



所以对于这个问题我运行程序,当模拟器打开时,我回到eclipse在DDMS透视和在设备选项卡中,按一个按钮重新启动adb服务器之前,控制台向我显示 emulator-5554断开连接!的消息。

I直到仿真器终于启动操作系统。

在仿真器上启动操作系统之后,eclipse不会发送断开连接错误,并且发送我已经构建的应用程序,也是控制台显示有关此消息。

然后终于出现在手机你好,Android上。



I am brand new to Eclipse and Android, but somewhat familiar with Java. That having been said, I tried to follow the 'Hello Android' tutorial from the developer site using the latest Eclipse (Galieo) and the 2.1 Android SDK, I am on a Macintosh running Snow Leopard (OS X 10.6). I have a default virtual device (though my target is actually for phones like my own HTC Incredible which has the snapdragon processor and of course all the latest accoutrement in smart phones).

Everything seemed to go okay until I went to RUN>RUN and then selected 'Android Application'. My computer spins its wheels for a while and then I see two errors. I have pasted the output from Eclipse below:

[2010-05-04 01:53:46 - HelloAndroid] ------------------------------
[2010-05-04 01:53:46 - HelloAndroid] Android Launch!
[2010-05-04 01:53:46 - HelloAndroid] adb is running normally.
[2010-05-04 01:53:46 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-05-04 01:53:46 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'myAVD'
[2010-05-04 01:53:46 - HelloAndroid] Launching a new emulator with Virtual Device 'myAVD'
[2010-05-04 01:53:58 - HelloAndroid] New emulator found: emulator-5554
[2010-05-04 01:53:58 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2010-05-04 01:53:59 - Emulator] 2010-05-04 01:53:59.501 emulator[10398:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2010-05-04 01:54:23 - HelloAndroid] emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!

I never do see the text in the emulator and the emulator crashes with a message about it quitting unexpectedly.

The crash report states:

Process:         emulator [10472]
Path:            /Applications/android-sdk-mac_86/tools/emulator
Identifier:      emulator
Version:         ??? (???)
Code Type:       X86 (Native)
Parent Process:  eclipse [10468]

Date/Time:       2010-05-04 02:25:41.153 -0500
OS Version:      Mac OS X 10.6.3 (10D573)
Report Version:  6

Interval Since Last Report:          2558914 sec
Crashes Since Last Report:           4
Per-App Crashes Since Last Report:   2
Anonymous UUID:                      C5F178C1-5290-4CA9-AD6E-E9C4F5582754

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000001fd2f000
Crashed Thread:  3

NOTE: Running the emulator from the command line with:

iainnitro-Mac:tools iainnitro$ ./emulator -avd myAVD

2010-05-04 02:49:23.011 emulator[10556:903] Warning once: This application, or a library it
uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw 
and move to Quartz.
Segmentation fault
iainnitro-Mac:tools iainnitro$

yields a segmentation fault(as noted above from the terminal output). So the emulator is dying on its own before anything can be shown.

I have tried restarting the ADB processes.

The actual code is line by line from the tutorial and I have never been able to get to the XML part yet.

I am not sure what is wrong with my environment setup or if it is just an incompatibility with Snow Leopard? I would REALLY appreciate any help in resolving this as I am very interested in developing on this platform.

Thank-you,

Mike N Lawrence, Kansas

解决方案

No direct experience, but this seems to be a recurrent issue:

This thread suggests:

You haven't let the emulator boot all the way up. Start it then wait until you see a desktop, just like on a real phone.

This one mentions (I suspect point 1. is not a concern for you):

  1. Get more RAM. I was running on 256 MB (which I believe is below minimum requirements), just upgraded today to 1024 MB (long time coming), application now starts fine. Although I still do see some error messages in the emulator, they don't seem to actually do anything.

  2. Install from command line. This is a bit laborius, but you can launch an emulator from the command line (assuming <android sdk path>\tools is added to your PATH variable) just type emulator, then browse to the location of your_app_here.apk, and execute

adb install your_app_here.apk

If you launch the emulator from Eclipse, execute adb kill-service and then adb start-service first (or kill-server / start-server. not sure the exact commands). Then your app will be installed on the emulator.


Also (a bit old but might still be relevant)

Maybe the emulator is running so slow, and the adb server, or another component like "DDMS" is a little "desperate" because seems it's waiting to the emulator to iniatialize the some HOME aplication.
But the emulator is running slow, the console in Eclipse send a message: emulator-5554 disconnected! Cancelling 'com.android.hello.HelloAndroid' launch!; and the emulator continues running normally and boot it's system, but don't run application that I build.

So for that problem I run program, and when the emulator is opened, I go back to eclipse in DDMS Perspective and in the Device tab y press a button "restart adb server" before the console shows me the message of "emulator-5554 disconnected!".
I do it several times until the emulator finally boot the OS.
After booted the OS on the emulator, eclipse don't send that disconnect error, and "sends" the app that I've built, also the console shows messages about this.
Then finally appears on the mobile "Hello, Android".

这篇关于问题与“你好Android”教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆