简体   繁体   English

OSM Bonus Pack迁移崩溃

[英]osm bonus pack migration crashing

I have a fully functional mapping Android app developed with osmdroid and the (very useful) osm bonus pack library. 我有一个使用osmdroid和(非常有用的)osm奖励包库开发的功能齐全的映射Android应用程序。 I have used osmdroid 3.0.10 and osm bonus pack v3.6. 我使用了osmdroid 3.0.10和osm红包v3.6。 I've been meaning to migrate to osm bonus pack v4.2.9 for some time now, to use some of the new features like marker clustering. 我一直想迁移到osm Bonus Pack v4.2.9已有一段时间,以使用一些新功能,例如标记群集。 When I tried to change it all, the first problem came with replacing the grouper of the markers with FolderOverlay, as explained in the osm bonus pack tutorials, and when defining: 当我尝试更改所有内容时,第一个问题是用osm Bonus Pack教程中说明的FolderFolderOverlay替换标记的分组器,以及定义时:

FolderOverlay = new FolderOverlay(this);

It crashes, with the following logcat output 它崩溃,并显示以下logcat输出

03-27 17:37:54.385      222-222/org.downtherabbithole E/AndroidRuntime﹕ java.lang.RuntimeException: Unable to start activity ComponentInfo{org.downtherabbithole/org.downtherabbithole.GeneralMapViews.GeneralMapActivity}: java.lang.NullPointerException
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
            at android.app.ActivityThread.access$2200(ActivityThread.java:119)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:123)
            at android.app.ActivityThread.main(ActivityThread.java:4363)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:521)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NullPointerException
            at org.osmdroid.views.overlay.OverlayManager.setTilesOverlay(OverlayManager.java:92)
            at org.osmdroid.views.overlay.OverlayManager.<init>(OverlayManager.java:27)
            at org.osmdroid.bonuspack.overlays.FolderOverlay.<init>(FolderOverlay.java:24)
            at org.downtherabbithole.droid.GeneralMapViews.GeneralMapActivity.onCreate(GeneralMapActivity.java:128)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
            at android.app.ActivityThread.access$2200(ActivityThread.java:119)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:123)
            at android.app.ActivityThread.main(ActivityThread.java:4363)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:521)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
            at dalvik.system.NativeStart.main(Native Method)

After this, and following the tutorial to use Marker Clustering, I replaced FolderOverlay with GridMarkerClusterer, it doesnt crash, but does later, when trying to set the marker location 之后,按照使用标记群集的教程进行操作,我用GridMarkerClusterer替换了FolderOverlay,它不会崩溃,但是稍后在尝试设置标记位置时会发生崩溃

Marker point = new Marker(mapView);
point.setPosition(new GeoPoint(XX.XXXXX, YY.YYYYY));

It crashes, with the NoSuchMethodError, Geolocation.clone(), why is this trying to call a clone() method on the Geolocation object, it didnt try to do this when i set the ItemizedOverlayWithBubble with osm bonus pack v3.6 使用NoSuchMethodError,Geolocation.clone()崩溃,为什么要尝试在Geolocation对象上调用clone()方法,当我使用osm红包v3.6设置ItemizedOverlayWithBubble时,它没有尝试执行此操作

Go

When you migrated to OSMBonusPack v4.2.9, did you also migrated your osmdroid jar to v4.1? 当您迁移到OSMBonusPack v4.2.9时,是否也将osmdroid jar迁移到了v4.1?

(this is mandatory: OSMBonusPack jars from v4.2.6 are based on osmdroid v4.1) (这是强制性的:v4.2.6中的OSMBonusPack jar基于osmdroid v4.1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM