mapbox / mapbox/mapbox-maps-flutter

Build fails with exception for Android

Open
#306 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

I have an existing project I am trying to migrate from google maps to mapbox. When I add `mapbox_maps_flutter: ^0.5.0` to my pubspec, and `SDK_REGISTRY_TOKEN` to my `gradle.properties` then try to build, I get the error below.

The issue does not appear to be with other dependencies. I can make a brand new flutter project, and build successfully if I copy+paste all the dependencies in from my real project. Any help would be appreciated, I'm not even really sure if this is an issue with this plugin.

```
FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\miles\AppData\Local\Pub\Cache\hosted\pub.dev\mapbox_maps_flutter-0.5.0\android\build.gradle' line: 18

* What went wrong:
A problem occurred evaluating project ':mapbox_maps_flutter'.
> Basedir C:\Users\miles\AppData\Local\Pub\Cache\hosted\pub.dev\cloud_firestore_web-3.6.3\android does not exist

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* Where:
Script 'D:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 412

* What went wrong:
A problem occurred configuring project ':mapbox_maps_flutter'.
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':mapbox_maps_flutter' of type org.gradle.api.Project.
> Could not find method implementation() for arguments [project ':flutter_plugin_android_lifecycle'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
> Could not get unknown property 'android' for project ':mapbox_maps_flutter' of type org.gradle.api.Project.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 11s

```

My dependencies:

```

environment:
sdk: '>=3.0.0 <4.0.0'
flutter: 3.10.6

dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter

mapbox_maps_flutter: ^0.5.0
flutter_js: ^0.7.0
dio: ^5.1.2
flutter_spinkit: ^5.1.0
provider: ^6.0.2
package_info_plus: ^4.0.2
url_launcher: ^6.1.0
flutter_secure_storage: ^8.0.0
json_serializable: ^6.1.5
intl: ^0.18.0
firebase_messaging: ^14.2.1
sentry: ^7.5.2
google_maps_flutter: ^2.3.0
flutter_background_geolocation: ^4.0.2
permission_handler: ^10.0.0
firebase_core: ^2.4.1
cloud_firestore: ^4.3.1
firebase_auth: ^4.5.0
firebase_storage: ^11.0.10
image_picker: ^0.8.5
retry: ^3.1.0
flutter_markdown: ^0.6.1
global_configuration: 2.0.0-nullsafety.1
flutter_redux: ^0.10.0
path_provider: ^2.0.9
file_picker: ^5.0.1
open_filex: ^4.1.1
uuid: ^3.0.6
json_at: ^2.1.0
custom_refresh_indicator: ^2.0.1
new_version_plus: ^0.0.4
version: ^3.0.2
flutter_keyboard_visibility: ^5.2.0
cached_network_image: ^3.2.0
connectivity_plus: ^4.0.0
messagepack: ^0.2.1
device_info_plus: ^9.0.0
community_material_icon: ^5.4.55
system_proxy: ^0.1.0
flutter_cache_manager: ^3.3.0
dotted_border: ^2.0.0+2
easy_debounce: ^2.0.2+1
flutter_local_notifications: ^14.0.0+1
azblob: ^2.3.0
json_schema2: ^2.0.2
collection: ^1.16.0
redux: ^5.0.0
path: ^1.8.2
json_annotation: ^4.8.0
firebase_analytics: ^10.1.0
isar: ^3.1.0+1
isar_flutter_libs: ^3.0.2
shared_preferences: ^2.0.17
flutter_logs: ^2.1.10
auth0_flutter: ^1.2.1

dev_dependencies:
test: ^1.20.2
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
build_runner: ^2.0.3
flutter_launcher_icons: ^0.13.1
mockito: ^5.0.15
corsac_jwt: ^1.0.0-nullsafety.1
flutter_lints: ^2.0.1
path_provider_platform_interface: ^2.0.0
plugin_platform_interface: ^2.0.0
# TODO once a release is made to mock server, update this to its new version
mockserver:
git:
url: https://github.com/mauriciotogneri/mockserver-dart.git
ref: 3fdf0615a5662975390ec4f96babf2663d6f9c48
isar_generator: ^3.0.2
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the project's pubspec dependencies and the mapbox_maps_flutter android/build.gradle file at line 18. Compare the failing project with the reported clean Flutter project, then inspect flutter.gradle around line 412 and run the Android build with the reported dependencies. Done means identifying whether the plugin or a dependency interaction causes the build failure and documenting a reproducible fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.