How Can I Update Gradle

I have a cordova app built in 2021 that I have to update but I can’t build for Android. Issues with Gradle.

Is there a Wappler way to update or re-install Gradle?

Command failed with exit code 1: /usr/local/Cellar/gradle/6.8.3/bin/gradle -p /Users/bradlawryk/Documents/Kopar/Apps/2023 Client Gateway App/platforms/android wrapper -b /Users/bradlawryk/Documents/Kopar/Apps/2023 Client Gateway App/platforms/android/wrapper.gradle
Error emulating your Cordova Project for android!

If you use Cordova you need to update those files, maybe from terminal, then on android studio select the gradle version under project settings, after doing that, locate the option “sync files with gradle”
Also check if the android version is compatible

Always backup…

Been trying all of that. Still get errors doing the updates. I even tried removing the Android Environment and re-adding it. No luck. I think I have to face it, my project is dead. At least for Android.

Remember to reboot as Gradle sets environmental paths which will need a restart to take effect Brad.

1 Like

Thanks Cheese, I hadn’t thought of that. I will try again today. Much appreciated.

1 Like

Did full shut downs and start ups and still no luck. I have come to the conclusion that my apps can not be updated and will be dead. :frowning:

Gradle updates are a total pain in the arse Brad. There are so many references in the build to the Gradle version you have to seek them all out and replace them (Wapplers search and replace can help there, of course always BACKUP first). Have you tried updating Gradle via Android Studio and then importing your Project and trying to build it with Android Studio? You’ll have to locate all those references and change them though. Also Wappler now being Capacitor focused over Cordova may have an impact on Wappler builds, although can not confirm that side personally as have not built a mobile application using Wappler for a fair few months now…

Also you can specify the path to Gradle in your Wappler settings under mobile options, maybe point this to the new Gradle version if you have not done so?

I wish there was more information on PWAs on here. It may be a better option for our use case. A project that very rarely needs updating, but when it does it is so out of date it cannot be updated and sent to app stores.

I will investigate that screenshot, thank you.

They are well documented on here and elsewhere really not that much to them. We carried out some tracking of installs and found that less than 3% of our Users actually install them (we have quite a large user base of over 20k regular/frequent/loyal registered Users). So we quit offering PWAs.

I have a Cordova app, and have stopped offering it to new customers, and now give them a PWA. Lots of reasons, but probably not important right now.

I’ve launched about a dozen tenants using: https://progressier.com/

I have nothing but good things to say about the service.

The dozen tenants have about 3,000 end users that have moved from web to PWA and the customers are very happy.

@brad maybe something has change on your environment setup.
What about creating a new app? It takes only 5 minutes…

  1. Create a mobile project
  2. Make sure capacitor is there
  3. Add android on Wappler
  4. Build on Wappler
  5. Open android studio
  6. Sync with gradle
  7. Build

If something is failing from there, well, you need to change something.

Also, as cheese points:

Another thing:
If you locate:
android/build.gradle
You will see:

  dependencies {
        classpath 'com.android.tools.build:gradle:8.2.1'

Try 8.0.0 which is pretty stable.
On Android Studio you can directly change it:

image

Thanks Ken, is it a hosted service? Or does it convert your current project and then you can stop paying? Looks interesting. Thank you.

Hosted service. Provides push notifications, install pages, notification and install prompts, splash screen, etc.

Thank franse, I have created a new blank app and it builds fine but using capicitor. I will try building a new cordova app but not sure how that will help me with my 4 year old app. I have tried everything even on Android studio it comes up with errors.

Bummer Ken, I don’t want a hosted service (or what exactly is hosted, the whole project? Or just the services?), I want to build my project in Wappler and host on our service provider that is required to be in Canada.

What happens if you run java -version on android studio terminal?

bradlawryk@Brads-MBP-16 android % java -v
Unrecognized option: -v
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
bradlawryk@Brads-MBP-16 android %

Sorry, it’s -version
My bad, my bad

java version "20.0.2" 2023-07-18
Java(TM) SE Runtime Environment (build 20.0.2+9-78)
Java HotSpot(TM) 64-Bit Server VM (build 20.0.2+9-78, mixed mode, sharing)

And what version of gradle is the one you’re trying to update?