AMapLocationClient.startup 时报错
jojo921 opened this issue · 1 comments
jojo921 commented
platform : android-arm64 • Android 9 (API 28)
code
PermissionStatus status = await Permission.locationWhenInUse.request();
if (status != PermissionStatus.granted) {
debugPrint("获取定位权限失败");
return;
}
await AMapLocationClient.startup(new AMapLocationOption(
desiredAccuracy: CLLocationAccuracy.kCLLocationAccuracyHundredMeters));
var location = await AMapLocationClient.getLocation(true);
debugPrint("$location");
#result:
Rejecting re-init on previously-failed class java.lang.Class<com.loc.ea$a>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/telephony/TelephonyManager$CellInfoCallback;
jiashenghuang-ponyai commented
这个貌似是因为TelephonyManager.CellInfoCallback
是Android 10(Api 29) 才添加的api,跑在Android 9上他就会找不到这个类……
作为安卓开发新手,我也遇到了这个问题,貌似无解