简体   繁体   中英

osm bonus pack migration crashing

I have a fully functional mapping Android app developed with osmdroid and the (very useful) osm bonus pack library. I have used osmdroid 3.0.10 and osm bonus pack 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. 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:

FolderOverlay = new FolderOverlay(this);

It crashes, with the following logcat output

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

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

Go

When you migrated to OSMBonusPack v4.2.9, did you also migrated your osmdroid jar to v4.1?

(this is mandatory: OSMBonusPack jars from v4.2.6 are based on osmdroid v4.1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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