« Error: The apk for your currently selected variant is not signed. | メイン

Android

Firebase を使用した MK(Machine Lerning) Kit サンプル

 Google Firebase のドキュメントからリンクされる公式リポジトリ quickstart-android
git clone git@github.com:firebase/quickstart-android.git
に含まれる MK Kit は、現時点でまともに動作しない。「ML Kit Vision Quickstart Sample App」と比較してソースも半分以上消えており 移行途中?・・・
 ネット上には Firebase を使用したMK Kit の断片的な利用情報が見つけられるので下記gitコマンドで
$ git -C ~/AndroidStudioProjects/github/quickstart-android log --diff-filter=D --summary
としてソース削除履歴を調べると
 :
commit b3c910f8441fdca3f696abb6744b076807fe9fc8
Author: DPEBot 
Date:   Mon Aug 24 09:05:15 2020 -0700

    Auto-update dependencies. (#1159)

    * Auto-update dependencies.

    * deprecating ML-Kit Android samples in favor of Firebase ML

 delete mode 100644 mlkit-langid/.gitignore
 delete mode 100644 mlkit-langid/app/.gitignore
 delete mode 100644 mlkit-langid/app/build.gradle
 delete mode 100644 mlkit-langid/app/proguard-rules.pro
 delete mode 100644 mlkit-langid/app/src/main/AndroidManifest.xml
 delete mode 100644 mlkit-langid/app/src/main/java/com/google/firebase/samples/apps/mlkit/languageid/EntryChoiceActivity.kt
 delete mode 100644 mlkit-langid/app/src/main/java/com/google/firebase/samples/apps/mlkit/languageid/java/MainActivity.java
 delete mode 100644 mlkit-langid/app/src/main/java/com/google/firebase/samples/apps/mlkit/languageid/kotlin/MainActivity.kt
 delete mode 100644 mlkit-langid/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
 delete mode 100644 mlkit-langid/app/src/main/res/drawable/ic_launcher_background.xml
 delete mode 100644 mlkit-langid/app/src/main/res/layout/activity_main.xml
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-hdpi/ic_launcher.png
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-mdpi/ic_launcher.png
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-xhdpi/ic_launcher.png
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
 delete mode 100644 mlkit-langid/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
 delete mode 100644 mlkit-langid/app/src/main/res/values/colors.xml
 delete mode 100644 mlkit-langid/app/src/main/res/values/strings.xml
 delete mode 100644 mlkit-langid/app/src/main/res/values/styles.xml
 delete mode 100644 mlkit-langid/app/src/screen.png
 delete mode 100644 mlkit-langid/build.gradle
 delete mode 100644 mlkit-langid/gradle.properties
 delete mode 100644 mlkit-langid/gradle/wrapper/gradle-wrapper.jar
 delete mode 100644 mlkit-langid/gradle/wrapper/gradle-wrapper.properties
 delete mode 100755 mlkit-langid/gradlew
 delete mode 100644 mlkit-langid/gradlew.bat
 delete mode 100644 mlkit-langid/settings.gradle
 delete mode 100644 mlkit-smartreply/.gitignore
 delete mode 100644 mlkit-smartreply/app/.gitignore
 delete mode 100644 mlkit-smartreply/app/build.gradle
 delete mode 100644 mlkit-smartreply/app/proguard-rules.pro
 delete mode 100644 mlkit-smartreply/app/src/main/AndroidManifest.xml
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/EntryChoiceActivity.kt
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/java/MainActivity.java
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/java/chat/ChatFragment.java
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/java/chat/ChatViewModel.java
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/java/chat/MessageListAdapter.java
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/java/chat/ReplyChipAdapter.java
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/java/model/Message.java
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/kotlin/MainActivity.kt
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/kotlin/chat/ChatFragment.kt
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/kotlin/chat/ChatViewModel.kt
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/kotlin/chat/MessageListAdapter.kt
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/kotlin/chat/ReplyChipAdapter.kt
 delete mode 100644 mlkit-smartreply/app/src/main/java/com/google/firebase/samples/apps/mlkit/smartreply/kotlin/model/Message.kt
 delete mode 100644 mlkit-smartreply/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/drawable/ic_camera_front_black_24dp.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/drawable/ic_launcher_background.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/drawable/ic_tag_faces_black_24dp.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/drawable/rounded_rectangle_blue.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/drawable/rounded_rectangle_gray.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/drawable/rounded_rectangle_light_gray.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/layout/chat_fragment.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/layout/item_message_local.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/layout/item_message_remote.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/layout/main_activity.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/layout/smart_reply_chip.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/menu/chat_fragment_actions.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-hdpi/ic_launcher.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-mdpi/ic_launcher.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-xhdpi/ic_launcher.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
 delete mode 100644 mlkit-smartreply/app/src/main/res/values/colors.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/values/dimens.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/values/strings.xml
 delete mode 100644 mlkit-smartreply/app/src/main/res/values/styles.xml
 delete mode 100644 mlkit-smartreply/app/src/screen.png
 delete mode 100644 mlkit-smartreply/build.gradle
 delete mode 100644 mlkit-smartreply/gradle.properties
 delete mode 100644 mlkit-smartreply/gradle/wrapper/gradle-wrapper.jar
 delete mode 100644 mlkit-smartreply/gradle/wrapper/gradle-wrapper.properties
 delete mode 100755 mlkit-smartreply/gradlew
 delete mode 100644 mlkit-smartreply/gradlew.bat
 delete mode 100644 mlkit-smartreply/settings.gradle
 delete mode 100644 mlkit-translate/.gitignore
 delete mode 100644 mlkit-translate/app/.gitignore
 delete mode 100644 mlkit-translate/app/build.gradle
 delete mode 100644 mlkit-translate/app/proguard-rules.pro
 delete mode 100644 mlkit-translate/app/src/main/AndroidManifest.xml
 delete mode 100644 mlkit-translate/app/src/main/java/com/google/firebase/samples/apps/mlkit/translate/EntryChoiceActivity.kt
 delete mode 100644 mlkit-translate/app/src/main/java/com/google/firebase/samples/apps/mlkit/translate/java/MainActivity.java
 delete mode 100644 mlkit-translate/app/src/main/java/com/google/firebase/samples/apps/mlkit/translate/java/TranslateFragment.java
 delete mode 100644 mlkit-translate/app/src/main/java/com/google/firebase/samples/apps/mlkit/translate/java/TranslateViewModel.java
 delete mode 100644 mlkit-translate/app/src/main/java/com/google/firebase/samples/apps/mlkit/translate/kotlin/MainActivity.kt
 delete mode 100644 mlkit-translate/app/src/main/java/com/google/firebase/samples/apps/mlkit/translate/kotlin/TranslateFragment.kt
 delete mode 100644 mlkit-translate/app/src/main/java/com/google/firebase/samples/apps/mlkit/translate/kotlin/TranslateViewModel.kt
 delete mode 100644 mlkit-translate/app/src/main/res/drawable-v21/ic_compare_arrows_black_24dp.xml
 delete mode 100644 mlkit-translate/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
 delete mode 100644 mlkit-translate/app/src/main/res/drawable/ic_compare_arrows_black_24dp.xml
 delete mode 100644 mlkit-translate/app/src/main/res/drawable/ic_launcher_background.xml
 delete mode 100644 mlkit-translate/app/src/main/res/layout/activity_main.xml
 delete mode 100644 mlkit-translate/app/src/main/res/layout/translate_fragment.xml
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-hdpi/ic_launcher.png
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-mdpi/ic_launcher.png
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-xhdpi/ic_launcher.png
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
 delete mode 100644 mlkit-translate/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
 delete mode 100644 mlkit-translate/app/src/main/res/values/colors.xml
 delete mode 100644 mlkit-translate/app/src/main/res/values/dimens.xml
 delete mode 100644 mlkit-translate/app/src/main/res/values/strings.xml
 delete mode 100644 mlkit-translate/app/src/main/res/values/styles.xml
 delete mode 100644 mlkit-translate/app/src/screen.png
 delete mode 100644 mlkit-translate/build.gradle
 delete mode 100644 mlkit-translate/gradle.properties
 delete mode 100644 mlkit-translate/gradle/wrapper/gradle-wrapper.jar
 delete mode 100644 mlkit-translate/gradle/wrapper/gradle-wrapper.properties
 delete mode 100755 mlkit-translate/gradlew
 delete mode 100644 mlkit-translate/gradlew.bat
 delete mode 100644 mlkit-translate/settings.gradle
▼▼▼
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/common/CameraImageGraphic.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/common/CameraSource.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/common/CameraSourcePreview.java
 delete mode 100644 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/common/preference/LivePreviewPreferenceFragment.java
 delete mode 100644 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/common/preference/PreferenceUtils.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/ChooserActivity.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/LivePreviewActivity.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/automl/AutoMLImageLabelerProcessor.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/barcodescanning/BarcodeGraphic.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/barcodescanning/BarcodeScanningProcessor.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/custommodel/CustomImageClassifier.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/custommodel/CustomImageClassifierProcessor.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/custommodel/LabelGraphic.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/facedetection/FaceContourDetectorProcessor.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/facedetection/FaceContourGraphic.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/facedetection/FaceDetectionProcessor.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/facedetection/FaceGraphic.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/imagelabeling/ImageLabelingProcessor.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/imagelabeling/LabelGraphic.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/objectdetection/ObjectDetectorProcessor.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/objectdetection/ObjectGraphic.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/textrecognition/TextGraphic.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/java/textrecognition/TextRecognitionProcessor.java
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/ChooserActivity.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/LivePreviewActivity.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/automl/AutoMLImageLabelerProcessor.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/barcodescanning/BarcodeGraphic.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/barcodescanning/BarcodeScanningProcessor.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/custommodel/CustomImageClassifier.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/custommodel/CustomImageClassifierProcessor.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/custommodel/LabelGraphic.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/facedetection/FaceContourDetectorProcessor.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/facedetection/FaceContourGraphic.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/facedetection/FaceDetectionProcessor.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/facedetection/FaceGraphic.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/imagelabeling/ImageLabelingProcessor.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/imagelabeling/LabelGraphic.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/objectdetection/ObjectDetectorProcessor.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/objectdetection/ObjectGraphic.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/textrecognition/TextGraphic.kt
 delete mode 100755 mlkit/app/src/main/java/com/google/firebase/samples/apps/mlkit/kotlin/textrecognition/TextRecognitionProcessor.kt
 ▲▲▲
delete mode 100755 mlkit/app/src/main/res/layout-land/activity_live_preview.xml
 delete mode 100755 mlkit/app/src/main/res/layout/activity_live_preview.xml

commit b67f8fcb9a793e34110473991416f3ce872385b5
Author: Sam Stern 
Date:   Wed May 20 15:25:29 2020 -0400

    Delete sdk_bug.md

 delete mode 100644 .github/ISSUE_TEMPLATE/sdk_bug.md
 :
Aug 24 09:05:15 のコミット"b3c910f8441fdca3f696abb6744b076807fe9fc8"で mlkit/* が ごっそり削除。その直前を調べると
$ git -C ~/AndroidStudioProjects/github/quickstart-android log
 :
commit b3c910f8441fdca3f696abb6744b076807fe9fc8 (HEAD -> master)
Author: DPEBot 
Date:   Mon Aug 24 09:05:15 2020 -0700

    Auto-update dependencies. (#1159)

    * Auto-update dependencies.

    * deprecating ML-Kit Android samples in favor of Firebase ML

commit 34283bffb02a7ff9ee1703100c4a9ceefc06e606 ★
Author: Sam Stern 
Date:   Wed Aug 19 05:34:11 2020 -0400

    Add link to MLKit support

commit f2676749632938d536741f2c5b6d668dfea7c4c7
Author: DPEBot 
Date:   Thu Aug 6 10:41:52 2020 -0700

    Auto-update dependencies. (#1157)

    * Auto-update dependencies.
 :
Aug 19 05:34:11 のコミット"34283bffb02a7ff9ee1703100c4a9ceefc06e606"へ戻す
$ git -C ~/AndroidStudioProjects/github/quickstart-android reset --hard 34283bffb02a7ff9ee1703100c4a9ceefc06e606
 求めていた Firebase を使用した MK(Machine Lerning) Kit の javaソースが復元。そのまま Android Studio で リビルド・ランすると実行できず下記エラー。
Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: Error loading build artifacts C:\Users\USER\AndroidStudioProjects\github\quickstart-android\mlkit\app\build\outputs\apk\debug\output-metadata.json
 調べると
Build-> Clean project

Build->Rebuild project

File->Invalidate Cashes /restart-> Invalidate and restart
まですると改善され、実行できる。
 前提:Andorid Studio 4.1.1、Pixel4 (Andorid 11)

トラックバック

このエントリーのトラックバックURL:
https://www.remix.asia/cgi/mt/mt-tb.cgi/7708

コメントを投稿

(いままで、ここでコメントしたことがないときは、コメントを表示する前にこのブログのオーナーの承認が必要になることがあります。承認されるまではコメントは表示されません。そのときはしばらく待ってください。)