在Android Skobbler地图显示黑屏 [英] Skobbler Maps on Android showing black screen

查看:223
本文介绍了在Android Skobbler地图显示黑屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Skobbler SDK 2.3.0,针对棒棒糖上是Nexus 5和Galaxy S4测试,在Android上构建工作室1.0.2。

I'm using Skobbler SDK 2.3.0, targeting Lollipop, testing on a Nexus 5 and Galaxy S4, building on Android Studio 1.0.2.

我有一个抽屉式导航栏和片段单一MainActivity。我在MainActivity初始化Skobbler并加载,显示地图的片段。不过,我只得到一个黑色的屏幕与技术侦察OSM在右下角的水印。单,双水龙头被注册,但如果我捏缩放的应用程序崩溃。

I've a single MainActivity with a navigation drawer and fragments. I initialize Skobbler in the MainActivity and load the fragment that displays the maps. However, I only get a black screen with the watermark "Powered by Scout OSM" at the bottom right. Single and double taps are registered, but if I pinch to zoom the app crashes.

我不应用程序崩溃之前看到logcat中的任何错误。谁能帮助?

I don't see any errors in logcat before the app crashes. Can anyone help?

项目结构:


  • 应用程序/库/ SKMaps.jar

  • 应用程序/ src目录/主/资产/ SKMaps.zip

  • 应用程序/ src目录/主/ jniLibs / armeabi / libngnative.so

  • 应用程序/ src目录/主/ jniLibs / armeabi-V7A / libngnative.so

  • 应用程序/ src目录/主/ jniLibs / 86 / libngnative.so

build.grade:

dependencies {
...
...
compile files('libs/SKMaps.jar')
}

的logcat

01-05 22:58:42.835 26785-26785 / com.example.android I / MainActivity:的onCreate
01-05 22:58:42.869 26785-26785 / com.example.android I / System.out的:在导航抽屉中选择项目
01-05 22:58:42.895 26785-26785 / com.example.android I / MainActivity:添加登录片段
01-05 22:58:42.895 26785-26785 / com.example.android I / MainActivity:完成
01-05 22:58:42.895 26785-26785 / com.example.android I / MainActivity:正在初始化Skobbler
01-05 22:58:42.899 26785-26785 / com.example.android I / MainActivity:开始initializeLibrary()
01-05 22:58:42.899 26785-26785 / com.example.android D / SKMaps:SKMapInitSettings ----地图风格[/storage/emulated/0/Android/data/com.example.android/files/SKMaps/ daystyle /,daystyle.json,-1]
01-05 22:58:42.899 26785-26785 / com.example.android D / SKMaps:SKVersionManager ---- setMapUpdateListener - com.example.android.MainActivity@1c8a98bc
01-05 22:58:42.899 26785-26785 / com.example.android I / MainActivity:结束initializeLibrary()
01-05 22:58:42.899 26785-26785 / com.example.android I / MainActivity:Skobbler初始化
01-05 22:58:42.899 26785-26785 / com.example.android I / MainActivity:结束的onCreate
...
01-05 22:58:55.790 26785-26785 / com.example.android D / SKMaps:SKMapSurfaceView ---- SKMapSurfaceView构造
01-05 22:58:55.790 26785-26785 / com.example.android D / SKMaps:SKMapSurfaceView ---- OS模式的Nexus 5
01-05 22:58:55.797 26785-26785 / com.example.android D / SKMaps:马prenderer ----设置地图密度3.0
01-05 22:58:55.800 26785-26785 / com.example.android D / SKMaps:SKMapSurfaceView ----关于暂停
01-05 22:58:55.803 26785-26785 / com.example.android D / SKMaps:SKMapSurfaceView ----保存地图缓存状态[图区域缩放= 17.0中心= [13.385000228881836,52.51665115356445] [显示模式= MODE_2D] [跟随模式= NONE] [指南针所示= false位置= [0.0,0.0] [旋转= TRUE] [摇摄= TRUE] [变焦= TRUE] [轴承= 0.0] [注释= 0]
01-05 22:58:55.811 26785-26785 / com.example.android E / BitmapFactory:无法取消code流:java.io.FileNotFoundException:空/ RES / xhdpi / icon_map_popup_navigate.png:打开失败:ENOENT (无此文件或目录)
01-05 22:58:55.813 26785-26785 / com.example.android E / BitmapFactory:无法取消code流:java.io.FileNotFoundException:空/ RES / xhdpi / icon_map_popup_arrow.png:打开失败:ENOENT (无此文件或目录)
01-05 22:58:55.822 26785-26785 / com.example.android D / SKMaps:SKMapSurfaceView ---- centerMapOnPosition [19.8171,41.3294]

推荐答案

您错过一条语句地图初始化后:

You're missing one statement after the map is initialized:

mapView.onResume();

如果你看看从Skobbler你看他们复制的纹理在一个活动并显示一个不同的地图中的例子。在活动可显示地图调用 mapView.onResume() mapView.onPause() 活动回调。如果要加载的纹理,并显示在同一个活动地图,你必须调用 mapView.onResume()

If you have a look at the example from Skobbler you see they copy the textures in one Activity and show the map in a different one. The Activity that shows the map calls mapView.onResume() and mapView.onPause() in the Activity callbacks. If you want to load the textures and show the map in the same Activity, you'll have to call mapView.onResume() after the resources are copied and the map is initialized.

这篇关于在Android Skobbler地图显示黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆