flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.04k stars 503 forks source link

FATAL EXCEPTION: MapboxTelemetryExecutor #1287

Closed marcoabat closed 1 year ago

marcoabat commented 1 year ago

Hi, I have a strange issue and the closed issues about this problem didn't help me. My App crashes at startup with the Exception:

D/CompatibilityChangeReporter(27240): Compat change id reported: 160794467; UID 10322; state: ENABLED
E/AndroidRuntime(27240): FATAL EXCEPTION: MapboxTelemetryExecutor
E/AndroidRuntime(27240): Process: com.example.mapbox_test, PID: 27240
E/AndroidRuntime(27240): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/mapbox/android/core/FileUtils;
E/AndroidRuntime(27240):    at com.mapbox.android.telemetry.errors.ErrorReporterEngine.sendReports(ErrorReporterEngine.java:48)
E/AndroidRuntime(27240):    at com.mapbox.android.telemetry.errors.ErrorReporterEngine$1.run(ErrorReporterEngine.java:34)
E/AndroidRuntime(27240):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
E/AndroidRuntime(27240):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
E/AndroidRuntime(27240):    at java.lang.Thread.run(Thread.java:1012)
E/AndroidRuntime(27240): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mapbox.android.core.FileUtils" on path: DexPathList[[zip file "/data/app/~~AoAjuTxSOYQHN_8wme5eAQ==/com.example.mapbox_test-Ey-nEFGKy--OwA8foAwTcQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~AoAjuTxSOYQHN_8wme5eAQ==/com.example.mapbox_test-Ey-nEFGKy--OwA8foAwTcQ==/lib/arm64, /data/app/~~AoAjuTxSOYQHN_8wme5eAQ==/com.example.mapbox_test-Ey-nEFGKy--OwA8foAwTcQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]]
E/AndroidRuntime(27240):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
E/AndroidRuntime(27240):    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(27240):    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime(27240):    ... 5 more
I/Process (27240): Sending signal. PID: 27240 SIG: 9
Lost connection to device.

This was already reported here. When I follow the suggested fix and the line implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:6.1.0' in android/app/gradle.build I'm getting the error:

Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.mapbox.android.telemetry.AlarmReceiver found in modules jetified-mapbox-android-telemetry-6.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:6.1.0) and jetified-mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
     Duplicate class com.mapbox.android.telemetry.AlarmSchedulerFlusher found in modules jetified-mapbox-android-telemetry-6.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:6.1.0) and jetified-mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)

This error was already reported here and here.

The project I'm getting this error in is a clean Flutter project. My only two packages are

mapbox_gl: ^0.16.0
flutter_dotenv: ^5.0.2

Flutter Version: 3.7.7 Dart Version: 2.19.4 Flutter Doctor:

[√] Flutter (Channel stable, 3.7.7, on Microsoft Windows [Version 10.0.19045.2251], locale de-DE)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.3)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.76.2)
[√] Connected device (4 available)
[√] HTTP Host Availability

• No issues found!

Basically one fix is telling me to implement mapbox-android-telemetry and the other fix is telling me to exclude it. Is this an issue with the package?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.