FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
130 stars 26 forks source link

Local run on android is not working - Gradle error #4789

Open amicable-io opened 3 weeks ago

amicable-io commented 3 weeks ago

Can we access your project?

Current Behavior

When I am trying to run an app in local android simulator I received an error. I tried to reset multiple times a flutterflow app and simulator. Also I tried to run it from android studio but the same issues.

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Upgrading build.gradle
Running Gradle task 'assembleDebug'...                          
Running Gradle task 'assembleDebug'...                             915ms

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/kamil/Library/Application Support/io.flutterflow.prod.mac/MYPROJECTNAME/android/settings.gradle' line: 12

* What went wrong:
A problem occurred evaluating settings 'android'.
> Cannot invoke method buildscript() on null object

* 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 423ms
Error: Gradle task assembleDebug failed with exit code 1

this is my settings.gradle file

`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()
    }    buildscript {
        repositories {
            mavenCentral()
            maven {
                url = uri("https://storage.googleapis.com/r8-releases/raw")
            }
        }
        dependencies {
            classpath("com.android.tools:r8:8.2.24")
        }
    }

}

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.3.0" apply false
    id "org.jetbrains.kotlin.android" version "1.8.10" apply false
    id "com.google.gms.google-services" version "4.3.8" apply false  // Google Services plugin
    id "com.google.firebase.crashlytics" version "2.9.9" apply false
}

include ":app"`

Expected Behavior

Local run will work without any issues....

Steps to Reproduce

  1. Open project
  2. Run simulator (in my case pixel 7a)
  3. Search for devices
  4. Select android device simulator
  5. Click test

Reproducible from Blank

Bug Report Code (Required)

ITFfl8nl5ZV1ocdD7q6JYO5V9SYWNWkcTLkvjuphcz8YGIztBJh/ZM/4U1VBUsu/S2lhHFGipHIKptLQjd7hLu4FOSSYbIRY/8x9VQLLRXq8R7aqC6i8ZnB7P8JMCEye56avhh5+KtJqSHdk712qF+itdCnqN5+/Zwh9f6PHaOI=

Visual documentation

Zrzut ekranu 2024-10-30 o 19 29 15

Environment

- FlutterFlow version: 5.0.9
- Platform: macOS, virtual device Android
- Browser name and version: desktop app
- Operating system and version affected: macOS Sequoia 15.0

Additional Information

No response

xoor-io commented 3 weeks ago

We're having the same issue. Could build during all day but suddenly we get that same build error.

pablo-manuele commented 3 weeks ago

I'm also having the same problem. A few projects that I can create an .apk file without a problem, but suddenly any of them is working. Hope to know how to solve it soon...

Extra note: I'm using FlutterFlow on Google Chrome.

Screen Shot 2024-10-30 at 20 29 52
jonystorm commented 3 weeks ago

+1

Alezanello commented 3 weeks ago

Hello!!

Thank you all for reporting this issue! The good news is that our engineering team is aware of it and is actively working on a fix, which will be deployed soon.

dicasvisuais commented 3 weeks ago

+1 here with same issue. I'm from Brazil and trying to solve this until 12PM... I hope that the FF team solve this soon. Its the lanuch week of my app 😨

dicasvisuais commented 3 weeks ago

Guys, i search in te forum community and found this solution that works for me [ FIRST COMMENT ]: https://community.flutterflow.io/ask-the-community/post/gradle-incompatible-version-8rzRlDhxQ09Ozfx

Hope that works for you guys! And Flutterflow team, maybe a notice from users that the Android Studio Version can cause this error. The Android Studio that i install here and works: android-studio-2024.1.2.13-mac_arm