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

android studio can't find java #78

Closed
lapisdecor opened this issue Oct 13, 2020 · 5 comments
Closed

android studio can't find java #78

lapisdecor opened this issue Oct 13, 2020 · 5 comments

Comments

@lapisdecor
Copy link

lapisdecor commented Oct 13, 2020

After update to the latest flutter and dart plugins, android studio can't find java.

Running Gradle task 'assembleDebug'...

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

Exception: Gradle task assembleDebug failed with exit code 1```
@lapisdecor
Copy link
Author

lapisdecor commented Oct 13, 2020

Also, I have a new Android folder on ~/ that I think wasn't previously there.

I'm using Android Studio 4.1
Build #AI-201.8743.12.41.6858069, built on September 23, 2020
Runtime version: 1.8.0_242-release-1644-b3-6222593 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.4.0-48-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 1998M
Cores: 6
Registry: ide.new.welcome.screen.force=true
Non-Bundled Plugins: Dart, io.flutter
Current Desktop: ubuntu:GNOME

@om26er
Copy link
Member

om26er commented Oct 14, 2020

I am not entirely sure if its related to the Android Studio snap package. FWIW, I have three instances of Android Studio updated to 4.1 and all seem to be working just fine. Need to wait to see if other people report that issue and can verify if non-snap installs are also affected.

@lapisdecor
Copy link
Author

I had it working on another machine before the android studio and flutter updates. I did an update on that machine too and run into problems. The problem may not be the snap but the explosive combination of java / gradle versions and android studio not reseting (it assumes old configuration). I got android studio working after erasing .config/Google and .local/share/Google but I still run into problems with gradle < 6 (which I think is a flutter problem). Java version must be openjdk not oracle and <= 11 for things to work.

@abderahimali
Copy link

how to resolve problem path of android studio installed by snap

@merlijn-sebrechts
Copy link
Member

Closing this as it was a java issue, not a snap issue.

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

4 participants