Ionic Live Reload Capacitor Gradle build - failed! Unable to locate a Java Runtime
Asked Answered
C

1

7

Live Reload not working anymore?

Now after the update to Capacitor Version 3 I can't use Live Reload in my Ionic Angular Project anymore. Unable to locate a Java Runtime. Has anyone else got the same issue?

I've followed the official Capacitor guide, also installed the native-run from ionic/cli. https://capacitorjs.com/docs/guides/live-reload#live-reload

Its not working!


This is the console error:

capacitor run android --no-sync --target LMQ610PJNVDUJV6TCQ

[capacitor] ✖ Running Gradle build - failed!

[capacitor] [error] The operation couldn’t be completed. Unable to locate a Java Runtime.

[capacitor] Please visit http://www.java.com for information on installing Java. [capacitor] [ERROR] An error occurred while running subprocess capacitor.

capacitor run android --no-sync --target LMQ610PJNVDUJV6TCQ exited with exit code 1.

Anybody got an idea what's the issue? Do I really need to install Java on Mac?? Thank you!!

Cloninger answered 21/5, 2021 at 13:56 Comment(2)
I would suggest you to check the feedback of Capacitor Update v3 and let a comment there if you cannot find any solution: github.com/ionic-team/capacitor/discussions/3994Advocate
Did you find a solution? Did you install Java in VSCode?Deportee
T
3

A little late, but I had the same problem - this was the solution someone found (specific to AndroidStudion on MacOS) about a week ago: https://forum.ionicframework.com/t/unable-to-locate-a-java-runtime-error-when-building-for-android-on-mac/221148

Follow these instructions closely - you don't want to install Java, you want to use the Java installation embedded inside AndroidStudio, which has all the ADK libraries and licenses already accepted.

Honestly, this only fixes the gradle-build problem of not being able to find Java, and isn't specifically about live-reload - but it was certainly preventing live-reload.

Teaching answered 18/3, 2022 at 20:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.