Android应用程序不会显示仿真器 [英] Android App Won't Display in Emulator

查看:177
本文介绍了Android应用程序不会显示仿真器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我要声明,我是一个新手,当涉及到Android(或Java,对于这个问题),所以肯定是有,我做错了什么在一个非常基本的水平有很大的可能性 - 请保留此记在心里。

Firstly, I want to state that I'm a novice when it comes to Android (or Java, for that matter) so there is certainly a strong possibility I'm doing something wrong at a very basic level - please keep this in mind.

我基本上会包括整个源,因为我不知道是哪里的问题是基于(以及任何建议我尝试使用谷歌之前,我已经在过去的几天这样做的)。

I will include basically the whole source as I have no idea where the problem is based (and before anyone suggests I try using Google, I've already spent the last couple of days doing that).

当我尝试运行或调试,我收到以下错误消息的应用程序会出现问题:

The problem occurs when I try to run or debug the app where I receive the following error message:

eclipse.buildId=M20100909-0800
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_NZ
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product


Error
Fri Feb 25 15:52:44 CET 2011
No command output when running: 'am start -n com.company.android.app/com.company.android.app.Home -a android.intent.action.MAIN -c android.intent.category.LAUNCHER' on device emulator-5554

com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408)
at com.android.ddmlib.Device.executeShellCommand(Device.java:276)
at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(Unknown Source)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launchApp(Unknown Source)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.simpleLaunch(Unknown Source)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.access$3(Unknown Source)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController$3.run(Unknown Source)

该应用程序是一个非常基本的东西。它与在查看以下XML code单一的活动:

The app is a very basic thing. It has a single Activity with the following XML code in the view:

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/helloAndroid" 
    android:text="" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
/>

和以下code在活动的*的.java:

And the following code in the Activity's *.java:

package com.company.android.app;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebView;
import android.widget.TextView;

public class Home extends Activity {

    TextView helloWorld;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        helloWorld = ( TextView ) findViewById( R.id.helloAndroid );
        helloWorld.setText( "Hello Android!" );
    }
}

最后,在我的Andr​​oidManifest.xml:

And finally, in my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.company.android.app"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="7" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Home"
                  android:label="@string/app_name"
                  android:theme="@android:style/Theme.NoTitleBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

当我运行或调试应用程序,我在控制台中看到以下内容:

When I run or debug the app I see the following in the console:

[2011-02-25 16:22:52 - com.company.android.app] adb is running normally.
[2011-02-25 16:22:52 - com.company.android.app] Performing com.company.android.app.Home activity launch
[2011-02-25 16:22:52 - com.company.android.app] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Android-2.3.3'
[2011-02-25 16:22:57 - com.company.android.app] Uploading com.company.android.app.apk onto device 'emulator-5554'
[2011-02-25 16:23:00 - com.company.android.app] Installing com.company.android.app.apk...
[2011-02-25 16:23:22 - com.company.android.app] Success!
[2011-02-25 16:23:23 - com.company.android.app] Starting activity com.company.android.app.Home on device emulator-5554

一点点额外的信息:

A little additional info:


  • 仿真器打开并运行 - 但从来没有得到超越Android的开机画面,也没有我可以通过按钮交互(即家什么都不做)

  • 该应用程序的目标是到Android 2.1 UPDATE1。

我想不出什么别的包括。

I can't think of anything else to include.

任何想法可能是造成这个问题?

Any ideas what might be causing this problem?

提前非常感谢。
扎克

Many thanks in advance. Zac

推荐答案

我发现这是由@erichamion在评论我的问题提供的解决方案。我重新启动通过AVD管理仿真的擦用户数据选项,并选中选项中的从快照启动选中。

The solution I found was provided by @erichamion in the comments to my question. I restarted the emulator via the AVD Manager with the "Wipe user data" option checked and the "Launch from snapshot" option unchecked.

我怀疑,当我第一次加载仿真器它是由我莫名其妙地中断,留在不可操作状态。清除用户数据和擦拭快照用新鲜的状态加载仿真器克服了这个问题。

I suspect that when I first loaded the emulator it was interrupted by me somehow and was left in an inoperable state. Clearing the user data and wiping the snapshot overcame that problem by loading the emulator with a fresh state.

感谢您的帮助...

这篇关于Android应用程序不会显示仿真器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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