OpenSprinkler / OpenSprinkler-App

A mobile interface for the OpenSprinkler irrigation device. Designed to allow manual control, program management (preview, add, edit, and delete), initiation of a run-once program, viewing graphical and tabulated representations of log data, viewing device status, adjusting rain delay, and changing of OpenSprinkler settings.
https://opensprinkler.com
GNU Affero General Public License v3.0
168 stars 91 forks source link

Cordova Build Failure - Android - Gradle ? #138

Closed trbom5c closed 1 year ago

trbom5c commented 1 year ago

I've been trying for a few days to build the UI App, but my "cordova build" keeps failing: image

I found this in the build.gradle: image

... and this in the cdv-gradle-config.json: image

Does anything appear out of place?

I did try changing the value in build.gradle to "GRADLE_VERSION" and get a different error when trying to run the build: image

Does someone have a functional environment config they're wiling to share?

Thank you for your support with this in advance.

salbahra commented 1 year ago

Be sure to clean your Android Studio completely if you have that installed, make sure to have the latest version of the SDK installed and lastly make sure you are using the latest version of Cordova. If you have it installed globally either remove it (I now include it locally) or update it to 12.

Let me know if the issue persists.

trbom5c commented 1 year ago

Thank you, @salbahra

Machine:

image image

Cordova Version: 12.0.0 (cordova-lib@12.0.1)

image

Gradle Version: 7.4.2

image

I've removed Android Studio from the system entirely; and ensured the most recent Android SDK (cli) has been installed on the system.

cordova requirements: image

I am still receiving this error:

image

I appreciate your response, and look forward to getting this resolved. Thank you, again!

salbahra commented 1 year ago

Please try deleting the platforms directory in the cloned repo, removing all old JDK's and gradle versions, updating to the latest Gradle, and then re-adding the Android platform. I would also suggest you just try using Android Studio directly instead of the CLI as I have better luck with that. If you get the issue in Android Studio, try cleaning the project build folder and try again.

trbom5c commented 1 year ago

I am still having no luck with this:

image

Let me know if there is a way in which I can contract you for individual support and consultation. :)

trbom5c commented 1 year ago

.....

I have absolutely no idea why retrying this worked this time .....

image

Thank you very much -- and my proposition for contracted support stands. I have some ideas for firmware and software implementation that I have no idea how to code/build.

trbom5c commented 1 year ago

After a successful build, where do I find the public_html web files?

salbahra commented 1 year ago

Glad to hear you were able to get it built and thank you for following up! I have run into this a few times and ultimately a few clean's did the trick. I also have no idea what is going on, to be completely honest.

Regarding contacted support, I apologize but I really don't have the time for that with everything happening on my side. I am happy to support you when I can here for things that everyone could benefit from though.

The public_html files should be populated by cordova prepare android step. If you are not seeing them then something is wrong with the prepare step. Is the HTML content completely missing? If so, are you seeing a blank page when loading the Android app?

trbom5c commented 1 year ago

Sorry, I meant to ask - Where do I find the built UI files to host on my domain? The built APK appears to be working fine. I currently have no app.js or home.js to put on my server for opening loading my new UI.

https://ui.mydomain.tld/js

Thank you!

Edit: Asked another way -- How do I build the UI files for hosting on my server? Then I can point my OS3.0 to my own servers to grab the modified UI and java.

Screenshot if anything looks out of the ordinary to a trained eye --- I am not a trained eye ....

image

salbahra commented 1 year ago

To build the UI files, you can simply run npx grunt makeFW. This will produce a zip file named UI.zip inside of build/firmware. This is the file you will need to extract to the destination of your choice.

trbom5c commented 1 year ago

I've started using platform IO to make project changes for the firmware --- so painless.

Would anyone mind walking me through the compiling steps in android studio IDE? I'm confident its more simple than trying to use cordova cli.

Is there a way to build the FW in android studio, or will that still be done with the makeFW on CLI?

Secondary -- I am not a developer, and need some support with finishing the app and firmware mods I am trying to deploy. Absolutely ready to compensate someone for their time and support -- I believe its likely less than 30 minutes of work for an actual developer.

Thank you!