79682650

Date: 2025-06-28 01:56:06
Score: 0.5
Natty:
Report link

Did you end up solving it? Just like you I am trying to use flutter 3.29 and I was getting this exact error.

I was upgrading a very old project from flutter 3.0.2 to a newer version and decided to upgrade to the latest version possible (3.29.0 at this time)

What worked for me was removing this form the build.gradle:

   flutter {
       source '../..'
   }

and then going directly to the dependency (Geolocator 5.0.1+1 in my case) folder android/build.gradle and directly giving it version numbers:

android {
    if (project.android.hasProperty("namespace")) {
        namespace("com.baseflow.geolocator")
    }
    compileSdkVersion 34

    // compileSdk flutter.compileSdkVersion

    defaultConfig {
        // minSdkVersion flutter.minSdkVersion
        minSdkVersion 26
    }
    lintOptions {
        disable 'InvalidPackage'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

What the error says is that it isn't recognizing "flutter" that's because of the flutter.xversion type of code. It will probably be fixed in the dependency itself in the future, but that's what worked for me.

Reasons:
  • Blacklisted phrase (1): I am trying to
  • Whitelisted phrase (-1): worked for me
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Did you
  • Low reputation (1):
Posted by: Angel Aquino