mapbox / mapbox/mapbox-maps-flutter

A problem occurred evaluating settings 'android'

Open
#799 6 comments 0 reactions 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 am trying to install and build a basic mapbox flutter app, the app runs well on IOS and i have no issue as i have followed the docs, but when i try to run the same app on android i get this error:

`flutter run
Launching lib/main.dart on Pixel 6 in debug mode...

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/rebin/Documents/OrbitalPoint.Co/Company Project/Cee/Apps/Cee-Flutter/cee_radar_and_navigation/android/settings.gradle' line: 25

* What went wrong:
A problem occurred evaluating settings 'android'.
> Could not get unknown property 'project' for Credentials [username: mapbox] of type org.gradle.internal.credentials.DefaultPasswordCredentials_Decorated.

* 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 395ms
Running Gradle task 'assembleDebug'... 935ms
Error: Gradle task assembleDebug failed with exit code 1`

i have followed the documentation and i have checked other people who had a somehow of a similar issue but none fixed the android issue i have right now.

i am using flutter "2.4.1", on android these are the setup that i currently have:

android/app/main/res/values/mapbox_access_token:

`

pk.eyJ1Ij......

`

android/app/build.gradle:

`
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

android {
namespace = "com.orbitalpoint.cee_radar_and_navigation"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.orbitalpoint.cee_radar_and_navigation"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
}
}
}

flutter {
source = "../.."
}
`

android/gradle.properties:

`
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
MAPBOX_DOWNLOADS_TOKEN=sk.ey...
`

android/settings.gradle:
`pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

repositories {
google()
mavenCentral()
gradlePluginPortal()

// Mapbox Maven repository
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'>
authentication {
basic(BasicAuthentication)
}
credentials {
username = "mapbox"
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
}
}

}
}

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

include ":app"

`

On IOS i have no issue and the app works and it display the mapbox map widget, but on android the app does not run at all, am i missing something or have i messed up the implementation?

i am using the latest version of flutter and mapbox library.

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 android/settings.gradle line 25 and compare its Mapbox Maven credentials block with android/gradle.properties, then run flutter run to reproduce the Android failure. Check the reported Gradle error and confirm that the Android build completes while the iOS map continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart, flutter
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.