【问题标题】:Don't see my app when running Android Studio emulator运行 Android Studio 模拟器时看不到我的应用
【发布时间】:2016-03-10 21:22:22
【问题描述】:

我遵循introductory tutorial 创建我的第一个 Android 应用程序。但是,当我运行模拟器时,我在任何地方都看不到我的应用程序图标,因此我无法对其进行测试。

这是我的 AndroidManifest.xml 文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.me.learning">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="com.example.me.learning.MyActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.me.learning.DisplayMessageActivity"
            android:label="@string/title_activity_display_message"
            android:parentActivityName="com.example.me.learning.MyActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.example.me.learning.MyActivity" />
        </activity>
    </application>

</manifest>

我在这里看到了图标:

这是 AVD 的控制台输出:

Hax is enabled Hax ram_size 0x60000000 HAX is working and emulator runs in fast virt mode. console on port 5554, ADB on port 5555

应用的控制台:

03/10 16:18:36: Launching app

所以 avd 和应用程序似乎都可以加载,但我在模拟器中的任何地方都看不到应用程序。我错过了什么?

这是屏幕:

这是主屏幕:

应用程序未显示。

【问题讨论】:

  • 你在真机上试过了吗?
  • 我有同样的问题,我遇到了问题

标签: android android-studio avd


【解决方案1】:

我也遇到过这个问题!这是我修复它的方法:

  1. 运行模拟器
  2. 在不关闭模拟器的情况下,进入此屏幕并单击左上角的按钮,该按钮看起来像一个从灰色框中出来的返回绿色箭头。它应该在停止按钮(红色方块)上方。 bottom left of android studio, click on run the the very bottom left and then click one of the little android logos to the left of the emulator run tab
  3. 在弹出的窗口中选择正在运行的模拟器

【讨论】:

    【解决方案2】:

    当您单击运行(顶部工具栏中的绿色小箭头,或键盘快捷键:SHIFT+F10)时,您应该会看到一个对话框,询问您想要什么设备运行您的应用程序。它不会问你想运行什么,如果这是你关心的。

    在该对话框中,只需选择 Launch emulator 并点击 OK

    【讨论】:

    • 我相信 OP 意味着模拟器启动,但应用程序没有加载。如果您点击绿色箭头,则应用程序应在您的模拟器完全启动时自动启动。也许您在代码中的某个地方出错了,您是否在 Android Studio 中遇到了错误?
    • 是的,我得到了那个对话框,然后我选择了特定的设备来进行仿真(Nexus 6 API 23)。模拟器启动了,我可以在里面乱七八糟,但我在任何地方都看不到我的应用程序。
    • @Timmiej93 我不认为我有任何错误。 Android Studio 没有以红色显示任何内容。
    • 您确定打开了Android Monitor 并选择了logcat 标签页吗?
    • 再次运行。第一次启动模拟器时,它只是在模拟器上“启动”系统等。此外,您应该在菜单中看到图标,它应该是默认的 android 徽标。
    【解决方案3】:

    我也遇到了同样的问题,我发现我有一些不兼容的红色下划线错误,我删除它们并再次运行它,它工作正常。

    【讨论】:

      【解决方案4】:

      我刚刚遇到了同样的问题。我认为您应该弄清楚消息窗口中显示的所有红色突出显示的问题。

      然后就可以了。

      祝你好运!

      【讨论】:

        【解决方案5】:

        运行apk文件直接安装,将文件从电脑文件夹拖到模拟器中

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2022-11-04
          • 2021-12-15
          • 1970-01-01
          • 2018-10-26
          • 2020-10-18
          • 2018-09-10
          • 2015-07-05
          • 1970-01-01
          相关资源
          最近更新 更多