admin管理员组

文章数量:1417070

I can't get Flutter to respect the version of gradle in android/gradle/wrapper/gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle/distributions/gradle-8.10.2-all.zip

Flutter keeps using Gradle 7.2 instead of 8.10

flutter analyze --suggestions
┌───────────────────────────────────────────────────────────────────┐
│ General Info                                                      │
│ [✓] App Name: app                                                 │
│ [✓] Supported Platforms: android, ios, web, macos, linux, windows │
│ [✓] Is Flutter Package: yes                                       │
│ [✓] Uses Material Design: yes                                     │
│ [✓] Is Plugin: no                                                 │
│ [✗] Java/Gradle/Android Gradle Plugin:                            │
│ Incompatible Java/Gradle versions.                                │
│ Java Version: 21.0.4, Gradle Version: 7.2                         │
│                                                                   │
│ See the link below for more information:                          │
│ .html#java │
│                                                                   │
└───────────────────────────────────────────────────────────────────┘

Am I missing some configuration?

I can't get Flutter to respect the version of gradle in android/gradle/wrapper/gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle./distributions/gradle-8.10.2-all.zip

Flutter keeps using Gradle 7.2 instead of 8.10

flutter analyze --suggestions
┌───────────────────────────────────────────────────────────────────┐
│ General Info                                                      │
│ [✓] App Name: app                                                 │
│ [✓] Supported Platforms: android, ios, web, macos, linux, windows │
│ [✓] Is Flutter Package: yes                                       │
│ [✓] Uses Material Design: yes                                     │
│ [✓] Is Plugin: no                                                 │
│ [✗] Java/Gradle/Android Gradle Plugin:                            │
│ Incompatible Java/Gradle versions.                                │
│ Java Version: 21.0.4, Gradle Version: 7.2                         │
│                                                                   │
│ See the link below for more information:                          │
│ https://docs.gradle./current/userguide/compatibility.html#java │
│                                                                   │
└───────────────────────────────────────────────────────────────────┘

Am I missing some configuration?

Share Improve this question asked Feb 2 at 20:19 karjankarjan 1,0161 gold badge11 silver badges19 bronze badges 2
  • I had some similar issues that I resolved by downgrading Java to 17. – abh Commented Feb 2 at 23:22
  • Try to build project (android folder) in Android Studio. It will configure missing things & if get any error, Try to upgrade JAVA. – ankushlokhande Commented Feb 3 at 4:13
Add a comment  | 

1 Answer 1

Reset to default 0

Ok, so what worked in the end was the removal of android folder and regenerating it again. I reverted all git changes so it was identical but this time worked. I don't know where Flutter stores additional data outside of project, but good enough for me.

本文标签: androidFlutter not respecting gradle versionStack Overflow