您好,建议您1.检查许可路径是否正确,注意使用
Environment.setLicensePath(android.os.Environment.getExternalStorageDirectory().getAbsolutePath()+"/SuperMap/license/");
其中路径的最后为许可文件所在文件夹名称+“/”;
2.确认是否给到设备存储读取权限,您可以使用
private void requestPermissions() { //Android6.0以上设备设置动态权限
if (Build.VERSION.SDK_INT >= 23) {
// 检查是否拥有权限
String[] permissions = {
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.ACCESS_WIFI_STATE,
Manifest.permission.ACCESS_NETWORK_STATE,
Manifest.permission.CHANGE_WIFI_STATE,
};
String permission = null;
int id = 0;
boolean isBreak = false;
int checkCallPhonePermission = 0;
for (int i = 0; i < permissions.length; i++) {
permission = permissions[i];
checkCallPhonePermission = checkSelfPermission(permission);
if (checkCallPhonePermission != PackageManager.PERMISSION_GRANTED) {
requestPermissions(permissions, id);
isBreak = true;
break;
}
}
}
}并在
super.onCreate(savedInstanceState);之后调用该方法;
希望可以帮助到您。