[Solved] Reviving a 1.6 Meteor app, problems with Cordova

I am trying to apply a hotfix for a server to an already deployed Meteor app using Cordova frontends. Cordova has always been troublesome, but just re-deploying an already working app turns out to be a nightmare.

First, I ran into the problem that you need 1.8 to make it work; newer versions like 1.11 were not accepted.

Then I had to downgrade the Android SDK tools. In the Meteor guide, Meteor recommends to use 26.x and higher for Meteor 1.6, but this is just not correct. The SDK 26.x tools are lacking the /templates/gradle folder, which kills the installation process again. So I downloaded the even older version 25.2.3, which is linked in the Guide. But this version breaks again, because the old gradle version it references cannot be downloaded anymore:

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 403 for URL: http://services.gradle.org/distributions/gradle-2.14.1-all.zip

Now I am pretty stuck, since none of the tools combinations actually works. Ok, the app is about three years old now, but not being able to even do a minimal fix to it is pretty crazy.

Does anyone have experiences with dealing with these situations and what get them overcome the gradle problem? Any help would be appreciated. Iā€™m on macOS Catalina.

After some digging into the Android build script code, I found a solution to the download problem. The root cause is gradle.org switched its servers to https instead of http.

A workaround for this is to set the following environment variable:

export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="https://services.gradle.org/distributions/gradle-2.14.1-all.zip"

There is still an exception occurring during build:

Could not read /Users/tom/Library/Android/sdk/platform-tools/api/annotations.zip
java.io.IOException: Could not parse XML from android/accounts/annotations.xml

but the build itself does not completely fail anymore.

1 Like