transistorsoft / flutter_background_geolocation

Sophisticated, battery-conscious background-geolocation & geofencing with motion-detection
https://www.transistorsoft.com/shop/products/flutter-background-geolocation
Other
651 stars 242 forks source link

Not compiling for Flutter 3.24.* #1382

Closed WUKS87 closed 3 days ago

WUKS87 commented 3 days ago

Your Environment

Expected Behavior

Should compile for Android SDK 34

Actual Behavior

Not compiling for Android SDK 34

Steps to Reproduce

  1. flutter build apk --flavor dev --debug
christocracy commented 3 days ago

You have something messed up in your gradle config.

WUKS87 commented 3 days ago

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"
christocracy commented 3 days ago

I suggest you first practice setting up the plug-in in a simple hello world app.

WUKS87 commented 3 days ago

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.