如何解决无法应用类 MapSettings 中的方法 setIsolatedDiskCacheRootPath (HereMaps)
大家好??
- 我正在尝试为 ReactNative 更新 HereMaps-Premium-Pack CodeBase 版本在 (V3.16) 上运行良好
- 我实际上使用的是新的 HereMaps-Premium-Pack 版本 (V3.18)
- 我收到此错误消息:
错误无法安装应用程序。确保你有安卓 开发环境搭建: https://reactnative.dev/docs/environment-setup。错误:命令失败: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 /Users/UserName/HereMapsProject/android/app/src/main/java/com/heremapsproject/HereMaps.java:117: 错误:类 MapSettings 中的方法 setIsolateddiskCacheRootPath 不能 应用于给定类型; 布尔成功 = com.here.android.mpa.common.MapSettings.setIsolateddiskCacheRootPath(context.getApplicationContext().getExternalFilesDir(null)
- File.separator + ".here-maps","globeIntent"); ^ 要求:找到的字符串:字符串,字符串原因:实际和正式 参数列表的长度不同 注意:一些输入文件使用或覆盖 已弃用的 API。注意:使用 -Xlint:deprecation 重新编译以获取详细信息。 1 个错误
我该如何解决这个问题..? ?
- 这是我的实际代码:
private void init(Context context) {
mContext = context;
mView = inflater.inflate(R.layout.mapview,this);
mapFragment = (AndroidXMapFragment) ((AppCompatActivity)((Contextwrapper) context).getBaseContext()).getSupportFragmentManager().findFragmentById(R.id.mapfragment);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
boolean success = com.here.android.mpa.common.MapSettings.setIsolateddiskCacheRootPath(context.getApplicationContext().getExternalFilesDir(null) + File.separator + ".here-maps","globeIntent");
if (!success) { Toast.makeText(context.getApplicationContext(),"Unable to set isolated disk cache path.",Toast.LENGTH_LONG);}
else { mapFragment.init(new OnEngineInitListener() { @Overridepublic void onEngineInitializationCompleted(OnEngineInitListener.Error error) {
if (error == OnEngineInitListener.Error.NONE) {
map = mapFragment.getMap();
map.setProjectionMode(Map.Projection.GLOBE);
map.setZoomLevel(initialZoomLevel);
map.setTilt(initialTilt);
map.setMapScheme(Map.Scheme.CARNAV_HYBRID_DAY);
map.setVisibleLayers(initialVisibleLayer,false);
mapFragment.getMapGesture().setDoubleTapEnabled(false);
mapFragment.getMapGesture().setTwoFingerPanningEnabled(false);
mapFragment.getMapGesture().setTwoFingerTapEnabled(false);
mapFragment.getMapGesture().addOnGestureListener(new MyGestureListener(),false);
map.addTransformlistener(new Map.OnTransformlistener() {
@Override
public void onMapTransformStart() {
}
@Override
public void onMapTransformEnd(MapState mapState) {
mMarkManager.interpretCountry(mapState.getCenter());
}
});
?这里是关于 setIsolateddiskCacheRootPath 的 Maps 文档:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。