【发布时间】:2020-07-10 19:54:16
【问题描述】:
geolocator 包有问题,当我在调试模式下运行我的应用程序时,一切正常,但是当我构建应用程序并使用发布模式时,它卡在我的加载屏幕中,其中包含来自 geolocator 包的 getcurrentlocation。
Future<void> getCurrentLocation() async {
try {
Geolocator geolocator = Geolocator()..forceAndroidLocationManager = true;
Position position = await geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.low,
);
latitude = position.latitude;
longitude = position.longitude;
} catch (e) {
print(e);
}
}
并且还添加到 android 清单访问。
【问题讨论】:
-
您是否将发布密钥添加到 Firebase 控制台?
-
我没有使用 firebase,我只使用来自 Flutter 包的 geolocator 插件
标签: android flutter dart plugins geolocation