Flutter项目连接失败:Lost connection to device问题求助(模拟器/真机均无效)
Flutter应用构建正常但安装时提示“Lost connection to device”无法连接设备
应用构建正常,但安装时始终提示“Lost connection to device”,无法连接到模拟器;尝试真机测试同样无效。已尝试多种可能的解决方案,但均未奏效。
错误日志
√ Built build\app\outputs\flutter-apk\app-debug.apk. W/FlutterActivityAndFragmentDelegate( 5693): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps. D/FlutterLocationService( 5693): Creating service. D/FlutterLocationService( 5693): Binding to location service. Lost connection to device. Exited (1)
已排查项
- 内存充足
- 无网络连接问题
flutter doctor -v检测无异常- 已清除模拟器数据后重试
使用环境信息
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
build.gradle(项目级)配置
dependencies { classpath 'com.android.tools.build:gradle:7.0.2' classpath 'com.google.gms:google-services:4.3.8' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }
build.gradle(应用级)配置
defaultConfig { configurations.all { resolutionStrategy { force 'androidx.work:work-runtime:2.6.0' } } applicationId "com.praveeshramroop.athena" minSdkVersion 23 targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true }
内容的提问来源于stack exchange,提问作者Praveesh Ramroop
相关产品推荐
相关产品推荐

