我无法在模拟器或真实设备上运行该应用程序。当我尝试从 VS Code 运行该应用程序时,它显示以下错误消息:
我尝试卸载该应用程序并执行flutter clean
.
无需更改包我也面临这个问题我刚刚修复了它:
-
进入 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:播放服务位置:21.0.1'
实现“androidx.core:core-ktx:1.3.2”
实现“org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version”
}
-
List item In project at android level go into build.gradle and add this line:
更新:添加了所需的代码
configurations.all{
resolutionStrategy{
force "com.google.android.gms:play-services-location:21.0.1"
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)