#Android Studio not detected if installed using Jetbrains Toolkit

1 messages · Page 1 of 1 (latest)

grave hedge
#

Toolkit installs it by default to the $HOME/.local/share/JetBrains/Toolbox/apps/android-studio

Adding this folder to $PATH does not seem to fix the issue.

Running shorebird doctor -v

k@desktop:~/StudioProjects/smazak> shorebird doctor -v
Shorebird 1.1.13 • [email protected]:shorebirdtech/shorebird.git
Flutter 3.22.2 • revision 7cab65034f8575e81d58774a91b99405ce2a2f7a
Engine • revision 28ed3b6c5fc12806e757067fdccb3614b4bd2ac1

Logs: /home/k/.config/shorebird/logs
Android Toolchain
  • Android Studio: not detected
  • Android SDK: /home/k/Android/Sdk
  • ADB: /home/k/Android/Sdk/platform-tools/adb
  • JAVA_HOME: not detected
  • JAVA_EXECUTABLE: /usr/bin/java
  • JAVA_VERSION: openjdk version "21.0.3" 2024-04-16
                  OpenJDK Runtime Environment (build 21.0.3+9-suse-1.1-x8664)
                  OpenJDK 64-Bit Server VM (build 21.0.3+9-suse-1.1-x8664, mixed mode, sharing)
                  
  • Gradle: unknown

✓ Shorebird is up-to-date (0.8s)
✓ Flutter install is correct (0.1s)
✓ AndroidManifest.xml files contain INTERNET permission (36ms)
✓ Has access to storage.googleapis.com (0.3s)
✓ shorebird.yaml found in pubspec.yaml assets (7ms)

No issues detected!
shadow sleet
#

How is this manifesting as an issue?

grave hedge
#
k@desktop:~/StudioProjects/smazak> shorebird init
✗ Detecting product flavors (3.3s)
Unable to extract product flavors.
Unsupported class file major version.

This error is typically caused by a mismatch between the Java and Gradle's versions.

Check our troubleshooting documentation for help. 


If you aren't sure why this command failed, re-run with the --verbose flag to see more information.

You can also file an issue if you think this is a bug. Please include the following log file in your report:
/home/k/.config/shorebird/logs/1719512033162_shorebird.log
#

troubleshooting mentions Android Studio

tawdry cloud
#

you should be able to fix that by installing a compatible a gradle compatible java version (iirc 17, but in our troubleshooting page you will find a compatibility matrix) and setting it in the JAVA_HOME env var

grave hedge
#

I have been building my app using Android Studio from the start, without the need to setup additional environmental variables. Why is there a need to manually install system wide Java for Shorebird.

tawdry cloud
#

Shorebird tries to autodetect your JAVA_HOME home. It first tries to first an android studio installation, and if one is not found, we look in the JAVA_HOME.

The java in your current JAVA_HOME is not supported by gradle apparently so this issue happens.

My suggestion is a way for you to not be blocked, as it seems that we have a bug in our Android Studio detection code.

grave hedge
tawdry cloud
grave hedge
#

yes, thats the one

tawdry cloud
#

any additional info that you might have is definitely appreciated!

#

in the mean time, if you change your JAVA_HOME to the jdk embeded in your Android Studio installation, you should be unblocked to use shorebird