Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行flutter报错 #1140

Open
DK3369 opened this issue Dec 14, 2024 · 1 comment
Open

运行flutter报错 #1140

DK3369 opened this issue Dec 14, 2024 · 1 comment

Comments

@DK3369
Copy link

DK3369 commented Dec 14, 2024

问题描述

运行flutter报错
Android Studio Ladybug | 2024.2.1 Patch 2

Flutter 3.27.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8495dee1fd (3 days ago) • 2024-12-10 14:23:39 -0800
Engine • revision 83bacfc525
Tools • Dart 3.6.0 • DevTools 2.40.2

请提供一个清晰而简明的问题描述。

Running Gradle task 'assembleDebug'...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'android'.

Could not open cp_proj generic class cache for build file 'pilipala/android/build.gradle' (/.gradle/caches/7.5/scripts/39iwfsj445e8nxuf5115pfdu0).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 65

  • 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.

BUILD FAILED in 2s

┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project's Gradle version is incompatible with the Java version that Flutter is using │
│ for Gradle. │
│ │
│ If you recently upgraded Android Studio, consult the migration guide at │
https://flutter.dev/to/java-gradle-incompatibility. │
│ │
│ Otherwise, to fix this issue, first, check the Java version used by Flutter by running flutter │ │ doctor --verbose. │
│ │
│ Then, update the Gradle version specified in │
pilipala/android/gradle/wrapper/gradle-wrapper.properties to be │
│ compatible with that Java version. See the link below for more information on compatible │
│ Java/Gradle versions: │
https://docs.gradle.org/current/userguide/compatibility.html#java
│ │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1

@guozhigq
Copy link
Owner

flutter 3.19.6
android studio 2022.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants