簡體   English   中英

Android Studio 中的 Android Emulator 不顯示我的應用

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

我目前正在使用 Android Studio 開發一個 android 應用程序。 當我在 Nexus 5 API 21 x86 模擬器上運行我的代碼時,模擬器不會顯示我正在嘗試調試的應用程序。 我進入了所有應用程序,但仍然找不到我要測試的應用程序。 但是,模擬器仍會顯示我正在處理的先前項目中的應用程序。 在編譯 gradle 和啟動模擬器時,日志也不會顯示任何錯誤。

通過研究其他帖子,我認為這可能與我正在運行的模擬器版本有關。 我不確定是否是這種情況,以及我將如何解決它。 我在下面粘貼了我的清單和我的 gradle.build 的副本。 請讓我知道出了什么問題,最近幾天這個問題一直困擾着我。

 <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>

和 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.+'

從 Android Studio,轉到 AVD 管理器(工具>Android>AVD)。 找到您的虛擬設備,然后在操作下,選擇向下的三角形並點擊擦除數據。 這應該刪除舊的測試 APK。

如果舊的應用程序仍然存在,請嘗試刪除舊的虛擬設備並創建一個新的虛擬設備。 如果它仍然存在,則您可能在啟動應用程序時選擇了錯誤的虛擬設備。

您還應該嘗試清除默認測試設備。 在 Run>Edit Configurations 下,選擇默認的運行配置。 在“常規”選項卡上,轉到“部署目標選項”下的底部,然后選擇“打開選擇目標部署對話框”,然后保存並重試。

我得到了解決方案。 您必須更改 adb.exe 文件下載adb.exe

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

享受

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM