找不到GeoJsonSource.finalize()的实现

时间:2019-10-10 13:42:39

标签: java mapbox mapbox-android

我正在尝试在我的Mapbox安卓地图上更改一些GeoJSON源。但是,该应用程序在加载时崩溃;引发此错误:

E/example.kultur: No implementation found for void
com.mapbox.mapboxsdk.style.sources.GeoJsonSource.finalize() (tried
Java_com_mapbox_mapboxsdk_style_sources_GeoJsonSource_finalize and
Java_com_mapbox_mapboxsdk_style_sources_GeoJsonSource_finalize__)

E/System: Uncaught exception thrown by finalizer E/System:
java.lang.UnsatisfiedLinkError: No implementation found for void
com.mapbox.mapboxsdk.style.sources.GeoJsonSource.finalize() (tried
Java_com_mapbox_mapboxsdk_style_sources_GeoJsonSource_finalize and
Java_com_mapbox_mapboxsdk_style_sources_GeoJsonSource_finalize__)
        at com.mapbox.mapboxsdk.style.sources.GeoJsonSource.finalize(Native Method)
        at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:289)
        at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:276)
        at java.lang.Daemons$Daemon.run(Daemons.java:137)
        at java.lang.Thread.run(Thread.java:919)

我认为触发此操作的代码是:

Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable processMarkerColorsRunnable = new Runnable() {

@Override
public void run() {
    RectF rectF = new RectF(
            mapView.getLeft(),
            mapView.getTop(),
            mapView.getRight(),
            mapView.getBottom()
    );
    List<Feature> inactive_features = mapboxMap.queryRenderedFeatures(rectF, "challenge-layer");
    List<Feature> active_features = mapboxMap.queryRenderedFeatures(rectF, "active-challenge-layer");
    LatLng currentLocation = new LatLng(mapboxMap.getLocationComponent().getLastKnownLocation());

    for (Feature feature : inactive_features) {
        LatLng location = parseFeature(feature);
        if (currentLocation.distanceTo(location) <= GEOFENCE_RANGE_IN_METERS) {
            active_features.add(feature);
            activeChallengesSource.setGeoJson(FeatureCollection.fromFeatures(
                    active_features));
            inactive_features.remove(feature);
            challengesSource.setGeoJson(FeatureCollection.fromFeatures(inactive_features));

        }
    }

其中activeChallengesSource是预定义的GeoJSONSource

有人遇到这样的事吗?

0 个答案:

没有答案