我无法在模拟器或真实设备上运行该应用程序。当我尝试从 VS Code 运行该应用程序时,它显示以下错误消息:
我尝试卸载该应用程序并执行flutter clean.
小智 59
无需更改包我也面临这个问题我刚刚修复了它:
进入 C:\Users\Qc\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\location-4.4.0\android\build.gradle :更改“com.google.android.gms:play-services -location:16.+” 到 “com.google.android.gms:play-services-location:21.0.1” 有效
依赖项 { api '"com.google.android.gms:play-services-location:21.0.1' 实现 "androidx.core:core-ktx:1.3.2" 实现 "org.jetbrains.kotlin:kotlin-stdlib-jdk7 :$kotlin_version" }
更新:添加了所需的代码
configurations.all{
resolutionStrategy{
force "com.google.android.gms:play-services-location:21.0.1"
}
}
Run Code Online (Sandbox Code Playgroud)
小智 15
当我在商店中启动该应用程序时,这个错误就发生在我身上。我现在正在更正它,将位置库更改为Gelocator。
起初我以为是Flutter 3.7.0的错误,我将版本降低到3.3.10和3.3.9,同样的问题仍然存在。我的解决方案是将位置库更改为地理定位器。它具有几乎相同的功能,我只需要进行一些更改。
https://pub.dev/packages/geolocator
| 归档时间: |
|
| 查看次数: |
20454 次 |
| 最近记录: |