Android Studio更新后模拟器操作失效:点击及系统按键无响应如何解决?
问题:Android模拟器点击及系统按键全部失效
更新Android Studio后,新建项目运行模拟器,界面能正常显示,但鼠标点击任何View/按钮都无效,模拟器的电源、音量加减、返回、主页、概览等系统按键也完全无法使用。
已尝试的无效方案:
- 冷启动模拟器
- 删除AVD文件中的
hardware-qemu.ini.lock文件(未找到该文件) - 重启电脑及Android Studio
项目相关代码
布局文件(activity_main.xml)
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> </androidx.constraintlayout.widget.ConstraintLayout>
MainActivity.kt
package com.myapplication import androidx.appcompat.app.AppCompatActivity import android.os.Bundle class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) } }
顶层build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { compose_version = '1.1.0' //add } ext.kotlin_version = '1.8.22' //1.6.21 -> 1.6.10 -> 1.8.0 -> 1.8.22 repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.8.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() mavenCentral() // Warning: this repository is going to shut down soon } } task clean(type: Delete) { delete rootProject.buildDir }
模块build.gradle
plugins { id 'com.android.application' id 'kotlin-android' } android { compileSdkVersion 35 //34->35 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.myapplication" minSdkVersion 21 //16 -> 19 -> 21로 변경 targetSdkVersion 34 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } namespace 'com.myapplication' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'androidx.core:core-ktx:1.15.0' implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.constraintlayout:constraintlayout:2.2.0' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.2.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' }
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.Gifty"> <activity android:name=".MainActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
解决方案建议
1. 检查模拟器输入设置
打开模拟器右侧的Extended Controls(三个点图标),进入Input标签:
- 确保
Mouse integration已勾选 - 确认
Touch screen mode设置为Multi-touch或Single-touch(不要选Disabled)
2. 重新创建AVD模拟器
Android Studio更新后旧AVD配置可能不兼容:
- 打开AVD Manager,删除当前失效的模拟器
- 新建AVD时,选择与项目
compileSdkVersion匹配的系统镜像(比如API 34/35),优先选带Google Play标识的镜像(兼容性更稳定)
3. 调整模拟器组件版本
打开SDK Manager的SDK Tools标签:
- 若刚更新Android Studio出现问题,尝试将
Android Emulator降级到上一个稳定版本 - 或确保所有SDK组件(Emulator、Platform Tools等)都更新到最新版本
4. 临时禁用硬件加速排查
如果硬件加速存在冲突:
- 编辑目标AVD的
Show Advanced Settings - 找到
Emulated Performance,将Graphics设置为Software - GLES 2.0,保存后重启模拟器
5. 清理Android Studio缓存
- 关闭Android Studio
- 删除对应缓存目录:
- Windows:
C:\Users\<你的用户名>\.AndroidStudio<版本>\system\caches - Mac:
~/Library/Caches/Google/AndroidStudio<版本>
- Windows:
- 重启Android Studio并重建项目
内容的提问来源于stack exchange,提问作者josephyumss
相关产品推荐
相关产品推荐

