mapbox / mapbox-maps-flutter

Interactive, thoroughly customizable maps for Flutter powered by Mapbox Maps SDK
https://www.mapbox.com/mobile-maps-sdk
Other
278 stars 107 forks source link

Release 2.1.0 and 2.2.0-rc.1 runs into Error on Android Devices. iOS compilation is OK #642

Open securexperts opened 1 month ago

securexperts commented 1 month ago

Hello,

I had upgraded to the latest Flutter version. Now I get an Error on Android Compiling

################################################################## flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc3) [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.1) [✓] IntelliJ IDEA Ultimate Edition (version 2024.1.5) [✓] Connected device (5 available)
[✓] Network resources

################################################################## flutter --version Flutter 3.24.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision 80c2e84975 (7 days ago) • 2024-07-30 23:06:49 +0700 Engine • revision b8800d88be Tools • Dart 3.5.0 • DevTools 2.37.2

################################################################## I run it on a MAC OSX M1

################################################################## Error Short trace: e: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/mapbox_maps_flutter-2.2.0-rc.1/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/MapboxMapController.kt:10:27 Unresolved reference 'ViewTreeLifecycleOwner'. e: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/mapbox_maps_flutter-2.2.0-rc.1/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/MapboxMapController.kt:73:11 Class 'MapboxMapController.LifecycleHelper' is not abstract and does not implement abstract member 'lifecycle'. e: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/mapbox_maps_flutter-2.2.0-rc.1/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/MapboxMapController.kt:84:5 'getLifecycle' overrides nothing. e: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/mapbox_maps_flutter-2.2.0-rc.1/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/MapboxMapController.kt:176:20 Unresolved reference 'ViewTreeLifecycleOwner'. e: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/mapbox_maps_flutter-2.2.0-rc.1/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/MapboxMapController.kt:183:5 Unresolved reference 'ViewTreeLifecycleOwner'.

FAILURE: Build failed with an exception.

BUILD FAILED in 17s Error: Gradle task assembleDebug failed with exit code 1

################################################################## Error trace is:

Task :mapbox_maps_flutter:compileDebugKotlin FAILED e: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/mapbox_maps_flutter-2.1.0/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/MapboxMapController.kt:10:27 Unresolved reference 'ViewTreeLifecycleOwner'. e: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/mapbox_maps_flutter-2.1.0/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/MapboxMapController.kt:72:11 Class 'MapboxMapController.LifecycleHelper' is not abstract and does not implement abstract member 'lifecycle'. e: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/mapbox_maps_flutter-2.1.0/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/MapboxMapController.kt:82:5 'getLifecycle' overrides nothing. e: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/mapbox_maps_flutter-2.1.0/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/MapboxMapController.kt:143:5 Unresolved reference 'ViewTreeLifecycleOwner'.

Task :platform_device_id_plus:compileDebugKotlin w: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/platform_device_id_plus-1.0.6/android/src/main/kotlin/com/di1shuai/platform_device_id/PlatformDeviceIdPlugin.kt:21:50 '@Deprecated(...) @NonNull() fun getFlutterEngine(): FlutterEngine' is deprecated. Deprecated in Java. w: file:///Users/romanbanz/.pub-cache/hosted/pub.dev/platform_device_id_plus-1.0.6/android/src/main/kotlin/com/di1shuai/platform_device_id/PlatformDeviceIdPlugin.kt:36:33 '@Deprecated(...) interface Registrar : Any' is deprecated. Deprecated in Java.

FAILURE: Build failed with an exception.

BUILD FAILED in 13s 428 actionable tasks: 12 executed, 416 up-to-date

Any Idea on how to solve this?

Many thanks for your help

mhammerc commented 1 month ago

Related to #629 and #633

saconger commented 1 month ago

had same issue. downgraded to flutter 3.22.2 and it compiled fine. fair solution until pull request related to #633 is resolved.