简体   繁体   中英

Emulator not running hello world

I setup the hello world project as per the tutorial ... and it did (at least once) display on the emulator (but not the first time, that I recall). I can't duplicate this. The log says:

[2011-10-04 17:11:38 - Hello World] ------------------------------
[2011-10-04 17:11:38 - Hello World] Android Launch!
[2011-10-04 17:11:38 - Hello World] adb is running normally.
[2011-10-04 17:11:38 - Hello World] Performing ca.daveg.helloworld.HelloWorld activity launch
[2011-10-04 17:11:38 - Hello World] Automatic Target Mode: Preferred AVD 'testA' is not available. Launching new emulator.
[2011-10-04 17:11:38 - Hello World] Launching a new emulator with Virtual Device 'testA'
[2011-10-04 17:11:42 - Emulator] emulator: warning: opening audio input failed
[2011-10-04 17:11:42 - Emulator] 

... which is odd. I don't know what audio has to do with anything ... and I do have a headset connected to the computer (with both mic and headphones attached).

The emulator just boots (and works fine) without displaying my app. I've tried 2.2, 2.3 and 3.1.something. I've tried different heap sizes. I've searched this site extensively, but none of the standard hints (running app.exe various ways, etc) have helped.

Even saying the emulator is slow --- I've waited for it, but my system is a 4.2Ghz i7 with 6 Gig of RAM and fast disks... so nothing can be terribly slow on it.

FYI, here's the code as I have it right now...:

package ca.somedomain.helloworld;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloWorld extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView tv = new TextView(this);
        tv.setText("Hello, Android 2");
        setContentView(tv);
    }
}

this problem has been explored numerous times with numerous resolutions.. it's not your code.

Try killing the adb by just issuing the command adb kill-server and then adb start-server on your command prompt.

some kill people kill the abd.exe process.. then do an uninstall of their application if that exists. If you search for this error.. you'll find plenty of example resolutions here on stackoverflow.

Ironically, the answer was provided not by anything I can find on the forums, but by the upgrade notes of the next version of the SDK:

The problem was a space in the filename of the package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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