2021-07-01から1ヶ月間の記事一覧

Assertion failed: Duplicate bundled template New Kotlin Property Initializer.kt

java.lang.Throwable: Assertion failed: Duplicate bundled template New Kotlin Property Initializer.kt [jar:file:/Applications/Android%20Studio%20Preview.app/Contents/plugins/Kotlin/lib/kotlin-idea.jar!/fileTemplates/code/New Kotlin Property…

Firestore purchasesはtopレベルのコレクションにするかusersの配下か

purchasesが一番上のコレクションの場合 DocumentId=orderIdにできる サーバ通知(pubsub or iosはonRequest)でFunctionsにアクセスがあった場合は、UIDで判別はできないのでこのやり方が便利 ドキュメントにUIDを持つ必要がある アプリで有料コンテンツにア…

basic-android-kotlin-training-intro-room-flow#7 Cannot access database on the main thread

https://developer.android.com/codelabs/basic-android-kotlin-training-intro-room-flow#7 上のページの最後でアプリを起動させることになってるが、起動しない。原因は下記。 github.com なので、次のページのFlowを導入するところまでやり切ってから起動…

リファレンスやgithubを見ているときに気になる英単語

garbled characters https://github.com/flutter/flutter/issues/55283 consecutive https://dart.dev/articles/libraries/creating-streams Splits a stream of consecutive strings into lines. decipher https://developer.android.com/codelabs/basic-an…

node-apple-receipt-verify PurchasedProductsにoriginalTransactionIdがない

Adding in-app purchases to your Flutter app | Google Codelabs import * as appleReceiptVerify from "node-apple-receipt-verify"; // Add typings for missing property in library interface. declare module "node-apple-receipt-verify" { interface…

tsconfigでよく問題になるオプション

随時追記 esModuleInterop https://www.typescriptlang.org/tsconfig#esModuleInterop Recommended: true Default: false falseの場合これで動く import * as parse from 'csv-parse/lib/sync'; parse(input, { columns: true, // 一行目をフィールドのkeyと…

flutter firestore_ref 3階層のコレクションをFactory constructorsで取得しやすくしてみる

/** * 親の親がorganizations,親がprojects */ class TeamsRef extends CollectionRef<Team, TeamDoc, TeamRef> { TeamsRef(this.cr) : super(cr); final CollectionReference<Map<String, dynamic>> cr; // 作ってみたもののあんまり意味がない factory TeamsRef.parentDoc(ProjectDoc doc) => TeamsRef(d</map<string,></team,>…

Firestore data bundles から余分な数字を取り除いて整形されたjsonでファイルに出力する

FlutterFireが新しくなったという下記の記事を見てdata bundlesのサンプルを書いてみることにしました。 invertase.io data bundles自体の詳細はこっち Cloud Firestore data bundles | Firebase サンプルを書いてるうちに中身を出力してみたくなりました。 …

Android エミュレータでGoogle アカウントに自動でログインする方法はないのか?

Play Billingなどを使う場合は、前もってgoogleアカウントにログインしておく必要があります。 エミュレータを初期化するなどすると消えてしまうのでその度ログインするのは面倒です。 今のところUI Automatorだけ成功 flutter_driverでなんとかする 現状で…

bash 現在ディレクトリ配下のディレクトリを全部git pushする

ls | xargs -r -I $ git -C ./$ push origin main push し忘れがないか心配になった時に使う

android-basics-kotlin/course 並行処理以降のチュートリアルで気になったこと

チュートリアルへの入り口 Android Basics in Kotlin course | Kotlin を用いた Android の基本 we don't recommend working with threads directly. Introduction to coroutines | Android Developers Performance issues, race conditions, and hard to re…

Flutter platformの判定

Platform.operatingSystemはエミュレータでは期待通りになるけど、 widget testなどでは、当たり前だけど、テストを実行しているパソコンのOS(windowsとかmac)になる。 Platform.isIOS,Platform.isAndroidなども同様。 さらにテスト時だけ変更したいなんてこ…

m1 mac flutter runでエラー

### Error LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 9): no suitable image found. Did find: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle: mach-o, but wrong architecture /Library/Ruby/Gems/2.6…

Flutter Android用のリソースIDが設定できない

play consoleのリリース前レポートの設定で認証情報にリソースIDを設定するところがあって、 flutterではどうやるんだろうと調べていたら下記のissueに辿り着きました。 github.com 結論としては、できないそうです。

Flutter in_app_purchase(android)の参考になるURLやハマりポイント

verifyPurchase pluginのreadmeを見ると下記のリンクが貼ってある Fight fraud and abuse | Google Play's billing system で上に書いてあることをそのまま実践しているようなfunctionsのソースが下記にあります。 play-billing-samples/PurchasesManager.ts…

hooks_riverpod useProvider is removed in favor of HookConsumerWidget

https://pub.dev/packages/hooks_riverpod/versions/1.0.0-dev.2/changelog ConsumerWidgetみたいに、build()の引数が一つ増えてref.watch()にproviderを入れるようです。 理由としては下記のようです。 [RFC] Unifying syntax for listening to providers (…