mapbox / mapbox/mapbox-maps-flutter

A problem occurred evaluating settings 'android'

Aperta
#799 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Dart
Stelle
380
Fork
204
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dalla riga 25 di android/settings.gradle e confronta il relativo blocco delle credenziali Mapbox Maven con android/gradle.properties, quindi esegui flutter run per riprodurre il problema Android. Controlla l'errore Gradle segnalato e conferma che la build Android venga completata mentre la mappa iOS continua a funzionare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, dart, flutter
Ambito
build-system, mobile
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.