简体   繁体   中英

Android app not showing in the emulator

I installed eclipse, android sdk, created AVD (tried with different versions), then created simple hello world program (autogenerated).

When I run it, it supposed to load up and show helloworld screen... but nothing happens. Emulator just loads up and shows android main screen. My app is nowhere to be seen.

Log:

[2012-05-19 19:09:34 - GameTest] Android Launch!
[2012-05-19 19:09:34 - GameTest] adb is running normally.
[2012-05-19 19:09:34 - GameTest] Performing org.test.game1.GameTestActivity activity launch
[2012-05-19 19:09:34 - GameTest] Automatic Target Mode: launching new emulator with compatible AVD 'def_avd'
[2012-05-19 19:09:34 - GameTest] Launching a new emulator with Virtual Device 'def_avd'

And that's it...

What is wrong and how can I actually load up my program?

Some clarifications: I tried to run emulator beforehand, and then running my app. I tried running emulator directly from eclipse "Run as - Android application" but still the same exact thing.

The thing missing is given below XML snippet in your AndroidManifest.xml

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Add this tag in your xml under activity tag, then your application will be launched on your Emulator

Unfortunately nothing suggested in other replies helped, but I found a decent workaround.

If you have an android device probably the simplest thing to do would be to connect it to usb and just hit "debug as android application" and in 3 or 4 seconds it will load up on your android device.

To use that option you need to instal USB driver package, but that is no problem.

clean the projects and refresh the emulator.

Other wise create new emulator and run it.

close the emulator and adb in windows task manager and

then try to create new emulator and run it.

Try this, first open the avd manager and launch the emulator, and wait until the emulator boots and android home screen shows up. Now try running the program.

I know this is an old question but I just had the same issue so here is how I fixed it in Android Studio 2.1.

In the Run configuration I had it set to start the AVD that I wanted automatically, and it would always start another AVD and none of them would have the app. So, I set the configuration to "Show Device Choose Dialog", started the AVD manually, and then when I hit Run I selected the running AVD and it popped right up. I hope it works for you too!

Also, I had set the Launch Option to start my main activity explicitly, and then I turned it back to default and it still worked after changing to default. So if it doesn't work for you the first time maybe try doing that too.

I had same issue when I was having one intent-filter for all the options, then I separated into 2 intent-filters, app started showing up

<intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data
             android:host="java-lang-programming"
             android:scheme="android-app-google-plus-demo" />
    </intent-filter>

Several things you might try :

  • Make sure the emulator build version is the same as code
  • Try and do :

     > adb kill-server > adb start-server
  • Restart Eclipse?

  • Check out This question and follow the answer guide.

  • Similar question Here , And Here check it out

Be sure to click "Use Host GPU" on Virtual Device Screen and then start your device. Wait until UI of the device is loaded.

只需一次检查构建路径并支持 android 库和 android 模拟器版本和应用程序支持版本和所有

I tried to fix it myself, but nothing seemed to be working,

So I just:

  1. Re-installed Visual Studio
  2. Reset my phone to factory default
  3. Went through the quick process of enabling USB Debugging ( Settings > About phone > Software information > Tap Build number seven times to enable Developer options > Go to Developer options (which is just below About phone in the Settings > Search for USB Debugging and enable it)
  4. Then I plugged in my phone again, and after installing USB driver package like NewProger suggested, I followed the usual steps to setting up my phone as an Android Emulator.

And it's working just fine now.

I can't exactly pinpoint what did it for me, but I guess there's no harm in trying all four steps, as a last resort, after backing up necessary files, and what not.

Hope this helps!

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