问题描述
大家好??
- 我正在尝试为 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 (将#修改为@)