Closed WUKS87 closed 3 days ago
You have something messed up in your gradle config.
This is my settings gradle (/android/settings.gradle):
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()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.4.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.25" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
id "com.google.firebase.crashlytics" version "2.9.9" apply false
}
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
I suggest you first practice setting up the plug-in in a simple hello world app.
I've been using the plugin for a while now.
Still it's possible to setup the configuration in old way with Flutter. The problem was in gradle version and kotlin.
Thank you.
Your Environment
Plugin version: 4.16.4
Platform: Android
OS version: Latest
Device manufacturer / model: /
Flutter info (
flutter doctor
):[✓] Flutter (Channel stable, 3.24.5, on macOS 14.5 23F79 darwin-x64, locale en-RS) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.3) [✓] VS Code (version 1.95.3) [✓] Connected device (4 available) [✓] Network resources
Plugin config:
Where: Script '/Users/admin/.pub-cache/hosted/pub.dev/flutter_background_geolocation-4.16.4/android/background_geolocation.gradle' line: 2
What went wrong: A problem occurred evaluating script.
Try:
Expected Behavior
Should compile for Android SDK 34
Actual Behavior
Not compiling for Android SDK 34
Steps to Reproduce