JAVA_HOME is set to an invalid directory

I’m trying to set up a mobile app. I’ve tried both Capacitor and Cordova and am getting the same error in both…

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Android\Android_Studio\jre.
Command failed with exit code 1:

Thing is, it’s not set to that at all…

Any pointers??

You can try and override the path using the Mobile Options available within Wappler @Heather_Mann

After setting the new path you may need to restart Wappler, and possibly your system.

Thanks for the suggestion. I made the change and restarted my computer.

I’m now getting errors:

Cordova
No Java files found that extend CordovaActivity.

Capacitor

There is no platform-tools folder in the jdk-20 directory.

Have you installed Android Studio? Usually the standard install options work out of the box.

Quick search revealed the following suggestion:

For our builds we use the terminal to manually install Capacitor to the Project. Seems to avoid a lot of these issues. Likewise with Android we use the terminal. We like to know exactly what we have installed and where. We also build in Android Studio, or again directly from the terminal, We do however create the design itself within Wappler. Sort of defies the objective of Wappler but it works. And until some features are fixed, updated, and tested. We’ll continue with this route to get Projects out the door.

I do have Android Studio installed. I’ll take a look at th link tomorrow. Thanks

1 Like

It occurred to me that I was pointing the SDK Path to the JDK so I moved that and that error resolved. Now I’m getting…

Have you tried building the Project in Android Studio itself @Heather_Mann?