maplibre / maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
https://maplibre.org
BSD 2-Clause "Simplified" License
1.03k stars 299 forks source link

[11.5.0 - Android] NoSuchFieldException on Launch #2893

Open ekamp opened 22 hours ago

ekamp commented 22 hours ago

Describe the bug Proguard looks to be stripping out a field needed during launch within MapRenderer causing a crash upon MapLibre init.

To Reproduce Steps to reproduce the behavior:

  1. Integrate latest 11.5.0 version of MapLibre into an Android app using proguard
  2. Launch app / call into MapLibre.init
  3. NoSuchFieldException thrown
java.lang.NoSuchFieldError: no "J" field "nativePtr" in class "Lorg/maplibre/android/maps/renderer/MapRenderer;" or its superclasses
2024-10-02 10:37:10.420 17036-17036 System.err              pid-17036                            W      at org.maplibre.android.net.NativeConnectivityListener.<clinit>(SourceFile:1)
2024-10-02 10:37:10.420 17036-17036 System.err              pid-17036                            W      at org.maplibre.android.net.b.d(SourceFile:19)
2024-10-02 10:37:10.420 17036-17036 System.err              pid-17036                            W      at org.maplibre.android.MapLibre.c(SourceFile:31)

Expected behavior No error thrown upon init

Screenshots N/A

Platform information (please complete the following information):

Additional context Nothing additional to add here, if proguard is not run everything works as expected / no issue is present

ekamp commented 22 hours ago

cc @louwers