android - Flutter not respecting gradle version - Stack Overflow

I can't get Flutter to respect the version of gradle in androidgradlewrappergradle-wrapper.prop

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745258107a4619078.html

相关推荐

  • android - Flutter not respecting gradle version - Stack Overflow

    I can't get Flutter to respect the version of gradle in androidgradlewrappergradle-wrapper.prop

    4小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信