mapbox / mapbox-plugins-android

Mapbox Android Plugins are a collection of libraries that extend our other SDKs, helping you design powerful mapping features while the plugins handle most of the heavy lifting.
https://www.mapbox.com/android-docs/plugins/overview/
BSD 2-Clause "Simplified" License
241 stars 120 forks source link

com.mapbox.mapboxsdk.style.sources.CannotAddSourceException: Source already exists #1170

Open D10NGYANG opened 3 years ago

D10NGYANG commented 3 years ago

when I use MapboxMap in My fragment 2021-01-11 16:05:41.619 14347-14347/com.jinribeidou.hailiao.test E/Mbgl-MapChangeReceiver: Exception in onDidFinishLoadingStyle com.mapbox.mapboxsdk.style.sources.CannotAddSourceException: Source mapbox-android-symbol-source-3 already exists at com.mapbox.mapboxsdk.maps.NativeMapView.nativeAddSource(Native Method) at com.mapbox.mapboxsdk.maps.NativeMapView.addSource(NativeMapView.java:937) at com.mapbox.mapboxsdk.maps.Style.addSource(Style.java:119) at com.mapbox.mapboxsdk.plugins.annotation.AnnotationManager.initializeSourcesAndLayers(AnnotationManager.java:351) at com.mapbox.mapboxsdk.plugins.annotation.AnnotationManager.access$200(AnnotationManager.java:38) at com.mapbox.mapboxsdk.plugins.annotation.AnnotationManager$1$1.onStyleLoaded(AnnotationManager.java:95) at com.mapbox.mapboxsdk.maps.MapboxMap.getStyle(MapboxMap.java:121) at com.mapbox.mapboxsdk.plugins.annotation.AnnotationManager$1.onDidFinishLoadingStyle(AnnotationManager.java:91) at com.mapbox.mapboxsdk.maps.MapChangeReceiver.onDidFinishLoadingStyle(MapChangeReceiver.java:198) at com.mapbox.mapboxsdk.maps.NativeMapView.onDidFinishLoadingStyle(NativeMapView.java:1166) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:363) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:8349) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)

D10NGYANG commented 3 years ago

SDK // MapBox 地图 implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.5.0' implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0' implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v9:0.12.0' implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-offline-v9:0.7.0'

compileSdkVersion 30
buildToolsVersion "30.0.3"