mapbox / mapbox/mapbox-maps-flutter
A problem occurred evaluating settings 'android'
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Dart
- Sterne
- 380
- Forks
- 204
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit android/settings.gradle Zeile 25 und vergleiche dessen Mapbox Maven-Anmeldedatenblock mit android/gradle.properties. Führe anschließend flutter run aus, um den Android-Fehler zu reproduzieren. Überprüfe den gemeldeten Gradle-Fehler und bestätige, dass der Android-Build abgeschlossen wird, während die iOS-Karte weiterhin funktioniert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- android, dart, flutter
- Bereich
- build-system, mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100