質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Cordova

Cordovaは様々なデバイスで使うことができるオープンソースなモバイル用開発プラットフォームです。開発者に各デバイスの元のプラットフォームで開発する必要をなくし、HTML・JavaScript・CSSなどの一般的なウェブのテクノロジーを使ってすべてのデバイスで展開することができるモバイルのアプリケーションを生成することを可能にします。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Q&A

0回答

1873閲覧

cordova9から11にアップデートし、API33でビルドすると、ビルドエラーとなる。

shigasaku

総合スコア0

Cordova

Cordovaは様々なデバイスで使うことができるオープンソースなモバイル用開発プラットフォームです。開発者に各デバイスの元のプラットフォームで開発する必要をなくし、HTML・JavaScript・CSSなどの一般的なウェブのテクノロジーを使ってすべてのデバイスで展開することができるモバイルのアプリケーションを生成することを可能にします。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

0グッド

0クリップ

投稿2023/01/17 08:46

前提

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の情報があまりにも少ないので、手詰まりの状態です。
よろしくお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問