前提
cordova9、API30ではビルドが通っていた。
Google Play ConsoleでAndroid 12 (APIレベル31)以上の対応が必要となったため、この度にこの対応を行う事となった。
使用しているcordovaプラグイン
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-fcm-with-dependency-updated-apns 1.0.0 "Cordova FCM Push Plugin"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-inappbrowser 4.1.0 "InAppBrowser"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-save-image 0.3.0 "SaveImage"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-wkwebview-engine 1.2.2 "Cordova WKWebView Engine"
cordova-plugin-wkwebviewxhrfix 0.1.0 "WKWebView XHR Fix"
ビルド環境
OS:Windows10
Android Studioのバージョン:Dolphin | 2021.3.1 Patch 1
ビルドまでの手順
cordovaをバージョンアップ後、以下のコマンドを実行しました。
cordova platform remove android
cordova platform add android@10.1.2
上記、実行後、
https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html
を参考にAndroid Studioで以下の設定を行いました。
※変更箇所のみ記載
Android Gradle Plugin Version:4.2.2
Gradle Version:7.1.1
Gradle JDK:Embedded JDK version 11.0.13
【CordovaLib】
Complile Sdk Version:30
Build Tools Version:30.0.3
※変更していないが、以下の2つは参考の為に記載
Source Compatibility:$JavaVersion.VERSION_1_8
Target Compatibility:$JavaVersion.VERSION_1_8
【app】
Complile Sdk Version:33
Build Tools Version:33.0.1
Source Compatibility:$JavaVersion.VERSION_11
Target Compatibility:$JavaVersion.VERSION_11
上記実行後にAndroid Studioのメニューの
Refactor → Migrate to AndoirdX...
を実行
実現したいこと
ビルドが通ること。
発生している問題・エラーメッセージ
Some problems were found with the configuration of task ':app:processDebugGoogleServices' (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. * Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Exception is: org.gradle.internal.execution.WorkValidationException: Some problems were found with the configuration of task ':app:processDebugGoogleServices' (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 'moduleGroup' 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 'moduleGroup'. 2. Remove the annotations on 'moduleGroup'. 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 'moduleGroupFirebase' 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 'moduleGroupFirebase'. 2. Remove the annotations on 'moduleGroupFirebase'. 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 'moduleVersion' 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 'moduleVersion'. 2. Remove the annotations on 'moduleVersion'. 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 'packageName' 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 'packageName'. 2. Remove the annotations on 'packageName'. Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem. 以下略
エラー箇所
> Task :app:processDebugGoogleServices FAILED
上記以外でFAILEDとなっている個所はありませんでした。
試したこと
platforms\android\build.gradle
にclasspath "com.google.gms:google-services:4.3.14"
を追記してみましたが、結果は変わらず。バージョンを4.3.8などに変えてみましたが、駄目でした。
google-services.jsonが所定のディレクトリに格納されているか、
bundle_idが正しいか、どうかも確認しましたが、特に問題となるような箇所はありませんでした。
以下を参考にしました。
https://github.com/apache/cordova-android/issues/1374
https://stackoverflow.com/questions/68604375/type-googleservicestask-field-intermediatedir-without-corresponding-getter/68713121#68713121
上記2つ以外にもいろいろとは試しはしたのですが、ビルドエラーは解消されませんでした。
cordovaのPUSH通知関連のプラグインに問題がありそうですが、それらを消しても解消はされませんでした。
日本語ページのWebの情報があまりにも少ないので、手詰まりの状態です。
よろしくお願いいたします。
あなたの回答
tips
プレビュー