Build error for Gradle Android app
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

Essentially we're building an Ionic cordova project, and recently due to Android Play Store, we've had to upgrade to API 30, We were on Cordova Android 8.+, however, the app would only produce a blank screen on an Android device, presumably because Cordova Android 8 doesn't support API level 30.

We updated to Cordova Android 10 because it is supports API 30, but we're having issues updating our build to actually successfully build as we are running into errors.

Take a look at stackoverflow for more specific details:

is there a minimal reproduction I can test on my local device?
redtemi 6 months ago

Crowdsource coding tasks.

1 Solution

-Appears to be an issue when building with Gradle 7.1.1 as described here:

-A PR was merged to resolve this issue so the first step is to isolate the problem. First you should try to determine if you can reproduce the issue with the current the latest version of ionic by getting a fresh project built with the current version, which includes the merged PR that addresses the issue.

-If you can build a fresh project, your next step is to start adding dependencies that your project relies on slowly, one by one, until you either get the same issue or you get no issues and have added all the dependencies that you need. For this case, I would start off with dependencies that have been called out by the build error. Also, have you tried removing any modifications that you have tried to "upgrade to googleservices 4.3.8" and let cordova deal with it via the PR?

You should remove and add plugins following these steps:
Notice how they say that it is not possible to "remove" plugins by modifying manually, but by using the commands. That could be one thing that is contributing to your issue.

  • Check your package.json to for the googleservices plugin version as if a plugin is defined in both the 'package.json' and the 'config.xml' file, the package.json is used as the source of truth, according to this link:

  • If you're able to reproduce the problem with a fresh ionic project, one suggestion is to address the build issue entirely by modifying the plugin yourself and adding a getter for the field described, or removing annotations.

By upgrading the plugin to version 4.3.8, I would imagine that 4.3.8 addresses this issue, but maybe it doesn't.... so that is what I would recommend, is taking a look at the source of the build issue and see if it is modified.