简体   繁体   English

Android Studio 中的 Android Emulator 不显示我的应用

[英]Android Emulator in Android Studio does not show my app

I'm currently working on an android application using Android Studio.我目前正在使用 Android Studio 开发一个 android 应用程序。 When I run my code on a Nexus 5 API 21 x86 emulator, the emulator does not show the application that I am trying to debug.当我在 Nexus 5 API 21 x86 模拟器上运行我的代码时,模拟器不会显示我正在尝试调试的应用程序。 I went into all applications, but I still cannot find the app I am trying to test.我进入了所有应用程序,但仍然找不到我要测试的应用程序。 However, the emulator does still show an app from a previous project that I was working on.但是,模拟器仍会显示我正在处理的先前项目中的应用程序。 The log doesn't show any errors either when compiling the gradle and starting up the emulator.在编译 gradle 和启动模拟器时,日志也不会显示任何错误。

From researching other posts, I believe it may have something to do with the version of the emulator I am running.通过研究其他帖子,我认为这可能与我正在运行的模拟器版本有关。 I am not sure if that is the case and if it is how I would fix it.我不确定是否是这种情况,以及我将如何解决它。 I have pasted a copy of my manifest below and my gradle.build.我在下面粘贴了我的清单和我的 gradle.build 的副本。 Please let me know what is wrong, this problem has been irritating me for the last several days.请让我知道出了什么问题,最近几天这个问题一直困扰着我。

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.jamescho.androidgame"
    android:versionCode="1"
    android:versionName="0.5" >

    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <application
        android:icon="@drawable/bxbx_char"
        android:label="Bxbx">
        <activity
            android:name="com.Bxbx.BxbxGame.Game"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:label="Bxbx"
            android:screenOrientation="portrait">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
                 <category android:name="android.intent.category.LAUNCHER"/>
             </intent-filter>
        </activity>
    </application>

</manifest>

And the build.gradle和 build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 17
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.jamescho.androidgame"
        minSdkVersion 8
        targetSdkVersion 17
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:18.+'

From Android Studio, go to the AVD manager (Tools>Android>AVD).从 Android Studio,转到 AVD 管理器(工具>Android>AVD)。 Locate your virtual device, and then under actions, select the downward triangle and hit Wipe Data.找到您的虚拟设备,然后在操作下,选择向下的三角形并点击擦除数据。 This should remove the old test APK.这应该删除旧的测试 APK。

If the old app is still there, try just deleting the old virtual device and creating a new one.如果旧的应用程序仍然存在,请尝试删除旧的虚拟设备并创建一个新的虚拟设备。 If it is still there, you are probably selecting the wrong virtual device when starting your app.如果它仍然存在,则您可能在启动应用程序时选择了错误的虚拟设备。

You should also try clearing the default testing device.您还应该尝试清除默认测试设备。 Under Run>Edit Configurations, select the default run configuration.在 Run>Edit Configurations 下,选择默认的运行配置。 On the General tab, go to the bottom under Deployment Target Options and select Open Select Target Deployment Dialog, then save and try again.在“常规”选项卡上,转到“部署目标选项”下的底部,然后选择“打开选择目标部署对话框”,然后保存并重试。

I got the Solution.我得到了解决方案。 You have to change the adb.exe file Download the adb.exe您必须更改 adb.exe 文件下载adb.exe

File Location: C:\\Users[USER]\\AppData\\Local\\Android\\sdk\\platform-tools文件位置:C:\\Users[USER]\\AppData\\Local\\Android\\sdk\\platform-tools

Enjoy享受

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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