-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Include a java too new path in android-java-gradle-migration #11708
base: main
Are you sure you want to change the base?
Conversation
Visit the preview URL for this PR (updated for commit ec8f316): https://flutter-docs-prod--pr11708-r-java-version-confustion-t-zsnn5gkp.web.app |
@@ -83,6 +83,27 @@ Do the following from the top of your Flutter project. | |||
$ ./gradlew wrapper --gradle-version=7.6.1 | |||
``` | |||
|
|||
## You didnt update android studio and still have a java error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missing apostrophe in "didn't"
r/android studio/Android Studio
r/java/Java
@@ -83,6 +83,27 @@ Do the following from the top of your Flutter project. | |||
$ ./gradlew wrapper --gradle-version=7.6.1 | |||
``` | |||
|
|||
## You didnt update android studio and still have a java error | |||
The error appears similar to `Unsupported class file major version 65`. | |||
This is an indication that your java version is newer than the version of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r/java/Java everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content LGTM, I'll let our tech writers review for style, format, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nitpicky comments.
|
||
### Solution 1: Use Android Studio | ||
The easiest way to resolve this issue is to use Android Studio AGP upgrade assistant. | ||
To use select your top level build.gradle file in Android Studio then select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use select your top level build.gradle file in Android Studio then select | |
To use select your top-level `build.gradle` file in Android Studio then select |
gradle you are running can handle. There is a non obvious set of dependencies | ||
surrounding AGP, java, and gradle. | ||
|
||
### Solution 1: Use Android Studio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Solution 1: Use Android Studio | |
### Solution 1: Android Studio |
Tools -> AGP Upgrade Assistant. | ||
|
||
### Solution 2: Command line | ||
Run `flutter analyze --suggestion` to see if your AGP, Java and gradle versions are compatible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run `flutter analyze --suggestion` to see if your AGP, Java and gradle versions are compatible. | |
Run `flutter analyze --suggestion` to see if your AGP, Java, and gradle versions are compatible. |
### Solution 2: Command line | ||
Run `flutter analyze --suggestion` to see if your AGP, Java and gradle versions are compatible. | ||
If Gradle needs to be updated you can update it with `./gradlew wrapper --gradle-version=SOMEGRADLEVERSION` | ||
where SOMEGRADLEVERSION is the version suggested by flutter analyze or newer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where SOMEGRADLEVERSION is the version suggested by flutter analyze or newer. | |
where SOMEGRADLEVERSION is the version (you can use a newer version) | |
suggested by `flutter analyze`. |
To find the java version being used run `flutter doctor` | ||
On a mac you can find the versions of java the OS knows about with `/usr/libexec/java_home -V` | ||
To set the version of java that all flutter projects use run `flutter config --jdk-dir=SOMEJAVAPATH` | ||
where SOMEJAVAPATH is a path to a java version like `/opt/homebrew/Cellar/openjdk@17/17.0.13/libexec/openjdk.jdk/Contents/Home` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To find the java version being used run `flutter doctor` | |
On a mac you can find the versions of java the OS knows about with `/usr/libexec/java_home -V` | |
To set the version of java that all flutter projects use run `flutter config --jdk-dir=SOMEJAVAPATH` | |
where SOMEJAVAPATH is a path to a java version like `/opt/homebrew/Cellar/openjdk@17/17.0.13/libexec/openjdk.jdk/Contents/Home` | |
To find the Java version being used run `flutter doctor`. | |
On a mac, you can find the Java versions that the OS knows about with `/usr/libexec/java_home -V`. | |
To set the version of Java that all flutter projects use run `flutter config --jdk-dir=SOMEJAVAPATH` | |
where SOMEJAVAPATH is a path to a Java version like `/opt/homebrew/Cellar/openjdk@17/17.0.13/libexec/openjdk.jdk/Contents/Home` |
Follow up on after some pairing with @anderdobo and @kenzieschmoll covering android agp updates.
Presubmit checklist