gpt4 book ai didi

java - osm 奖励包迁移崩溃

转载 作者:太空宇宙 更新时间:2023-11-04 14:59:44 26 4
gpt4 key购买 nike

我有一个使用 osmdroid 和(非常有用的)osm 奖励包库开发的功能齐全的 Android map 应用程序。我使用了 osmdroid 3.0.10 和 osm Bonus Pack v3.6。一段时间以来,我一直想迁移到 osm Bonus Pack v4.2.9,以使用一些新功能,例如标记聚类。当我尝试改变这一切时,第一个问题是用FolderOverlay替换标记的分组,如osm奖金包教程中所述,以及定义时:

FolderOverlay = new FolderOverlay(this);

它崩溃了,并显示以下 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)

在此之后,并按照使用标记聚类的教程,我将FolderOverlay替换为GridMarkerClusterer,它不会崩溃,但稍后在尝试设置标记位置时会崩溃

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

它崩溃了,出现NoSuchMethodError,Geolocation.clone(),为什么尝试调用Geolocation对象上的clone()方法,当我使用osm Bonus Pack v3.6设置ItemizedOverlayWithBubble时它没有尝试这样做

最佳答案

当您迁移到 OSMBonusPack v4.2.9 时,您是否也将 osmdroid jar 迁移到 v4.1?

(这是强制性的:v4.2.6 中的 OSMBonusPack jar 基于 osmdroid v4.1)

关于java - osm 奖励包迁移崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22724697/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com