Build failing after upgrade cordova-android 10
See original GitHub issueBug Report
Problem
When I upgraded cordova-android@9.0.0
to cordova-android@10.1.1
I’ve got a build problem when I run:
cordova build android --release --buildconfig=build.json
What does actually happen?
Problems:
* What went wrong:
Some problems were found with the configuration of task ':app:processReleaseGoogleServices' (type 'GoogleServicesTask').
- In plugin 'com.google.gms.googleservices.GoogleServicesPlugin' type 'com.google.gms.googleservices.GoogleServicesTask' field 'intermediateDir' without corresponding getter has been annotated with @OutputDirectory.
Reason: Annotations on fields are only used if there's a corresponding getter for the field.
Possible solutions:
1. Add a getter for field 'intermediateDir'.
2. Remove the annotations on 'intermediateDir'.
Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
- In plugin 'com.google.gms.googleservices.GoogleServicesPlugin' type 'com.google.gms.googleservices.GoogleServicesTask' field 'packageNameXOR1' without corresponding getter has been annotated with @Input.
Reason: Annotations on fields are only used if there's a corresponding getter for the field.
Possible solutions:
1. Add a getter for field 'packageNameXOR1'.
2. Remove the annotations on 'packageNameXOR1'.
Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
- In plugin 'com.google.gms.googleservices.GoogleServicesPlugin' type 'com.google.gms.googleservices.GoogleServicesTask' field 'packageNameXOR2' without corresponding getter has been annotated with @Input.
Reason: Annotations on fields are only used if there's a corresponding getter for the field.
Possible solutions:
1. Add a getter for field 'packageNameXOR2'.
2. Remove the annotations on 'packageNameXOR2'.
Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
- In plugin 'com.google.gms.googleservices.GoogleServicesPlugin' type 'com.google.gms.googleservices.GoogleServicesTask' field 'quickstartFile' without corresponding getter has been annotated with @InputFile, @Optional.
Reason: Annotations on fields are only used if there's a corresponding getter for the field.
Possible solutions:
1. Add a getter for field 'quickstartFile'.
2. Remove the annotations on 'quickstartFile'.
Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
- In plugin 'com.google.gms.googleservices.GoogleServicesPlugin' type 'com.google.gms.googleservices.GoogleServicesTask' field 'searchedLocation' without corresponding getter has been annotated with @Input.
Reason: Annotations on fields are only used if there's a corresponding getter for the field.
Possible solutions:
1. Add a getter for field 'searchedLocation'.
2. Remove the annotations on 'searchedLocation'.
Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
Information
I’ve already tried:
- Updated some dependencies outdated
- Remove
cordova-android-play-services-gradle-release
cordova-android-support-gradle-release
cordova-support-google-services
- Add in
config.xml
<preference name="GradlePluginGoogleServicesEnabled" value="true" />
and<preference name="GradlePluginGoogleServicesVersion" value="4.3.8" />
but when I did that, I’ve got another error:
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.google.gms.google-services'.
> Cannot add extension with name 'googleServices', as there is an extension already registered with that name.
Command or Code
Environment, Platform, Device
This problem occurs in windows and linux.
Version information
Ionic CLI: 5.4.16 Ionic Framework: ionic-angular 3.9.8 @ionic/app-scripts: 3.2.4
Cordova CLI: 10.0.0 Cordova Platorms: android 10.1.1
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- I included all the necessary information above
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:22 (3 by maintainers)
Top Results From Across the Web
Build failing after upgrade cordova-android 10 - Stack Overflow
Possible solutions: 1. Add a getter for field 'intermediateDir'. 2. Remove the annotations on 'intermediateDir'. Please refer to https://docs.
Read more >Failed to update Cordova Platforms to android@10 - Ionic Forum
i'm trying to update cordova platform in my ionic application from android@9 to android@10 ionic cordova platform remove android ionic ...
Read more >Build failing after upgrade cordova-android 10 - AndroidBugFix
Possible solutions: 1. Add a getter for field 'intermediateDir'. 2. Remove the annotations on 'intermediateDir'. Please refer to https://docs.
Read more >Cordova Android 10.0.1 Released!
We are happy to announce that we have just released a bugfix update for Cordova Android (10.0.1) ! This is one of Cordova's...
Read more >Upgrading Cordova-Android Version to Meet Required ... - Ionic
Create a new terminal or command prompt session · Navigate to the project directory · Run the following command: cordova platform rm android...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cool-projects I was about to close this issue because I got a solution that solves the problem. As it is not ideal, I will still leave this issue open to see if any maintainer fixes this issue.
Solution: https://stackoverflow.com/questions/69856650/build-failing-after-upgrade-cordova-android-10
It’s happening to me too! any ideias??