_AssertionError (‘package:google_mobile_ads/src/ad_instance_manager.dart’: Failed assertion: line 666 pos 7: ‘adIdFor(ad) != null’: Ad has not been loaded or has already been disposed.)

動作環境 Flutter 3google_mobile_ads 2flutter で admobをリワードで表示して、二度目のリワードを表示をするとタイトルのエラーが発生しました。 エラーの原因と解消方法 1度目のリワードを表示が完了したときに、変数をnullしてやるとエラーが解消されます。以下参考コードです。 _rewardedAd!.show( onUserEarnedReward: (AdW ...
CocoaPods could not find compatible versions for pod “GoogleAppMeasurement” のエラー

エラーの内容 $ arch -x86_64 pod install Analyzing dependencies cloud_firestore: Using Firebase SDK version '9.6.0' defined in 'firebase_core' firebase_analytics: Using Firebase SDK version '9.6.0' defined i ...
No implementation found for method _init on channel plugins.flutter.io/google_mobile_ads

環境 Flutter 3google_mobile_ads 2 状況 MobileAds.instance.initialize()が実行されると、タイトルのエラーが出る。コメントアウトすると出ない。 Solved (解決した方法) google_mobile_ads のバージョンを1.3に下げた。 その後 再度、google_mobile_adsのバージョンを2に上げて、タイトルのエラー解消のチ ...
Flutter Firestore データ 一覧 取得 snapshot Instance of ‘_JsonQueryDocumentSnapshot’

Summary (要約) FlutterとFirestoreを使って、Firesotreのデータを一覧で取得しました。しかし、printで見てみると、Instance of '_JsonQueryDocumentSnapshot'なる表示がされて、値が取得できているのかわかリませんでした。Webのサンプル通りやっているのに、なぜこうなるのだろう。 Solved (解決) 解決したコードを表示します ...
Exception has occurred. FirebaseException ([cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation.)

エラーの原因 firestoreのruleでerrorが出ています。firestoreのruleをmodifyしてください。 例えば、以下の設定にすると解決します。 rules_version = '2'; // 全てを許可する設定 service cloud.firestore { match /databases/{database}/documents { match /{d ...
firebase function delopyに失敗(初心者用)

$ firebase deploy --only functionsを実行して、失敗しました。 Functions deploy had errors with the following functions:helloWorld(us-central1)i functions: cleaning up build files… Error: There was an error deployin ...
MissingPluginException (MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite))

flutter で sqliteを利用しようとすると発生するエラー。自分の場合は、flutter clean をしてから、デバッグ実行をしたら、解決しました。
Could not build the application for the simulator. Error launching application on iPhone [sloved]

FlutterでiOSのシミュレータを起動したときに起きるバグです。いきなり発生します。 flutter clean cd ios pod update iosフォルダ内にある「Podfile.lock」ファイルを削除 cd ./ios pod install --repo-updateとかやっていれば、なおることもあります。が、治らないこともあります。この場合は、Macを再起動してから、新しいF ...
Dart Json サンプル

自分用のDartのJsonのサンプルです。このような簡単なDartのプログラムを確認のために実行するときはこのサイトを利用します。 import 'dart:convert'; void main() { String jsonString = ''' { "name": "徳川家康", "email": "tokugawa@example.com" }'''; Map<String, St ...
yarn testを実行すると、Cannot find module ‘fs’ or its corresponding type declarations.のエラー

動作環境 typescript (version 4.8.3)jest (version 29)node (version 16) Resolved (解決方法) tsconfig.jsonのtypesに"node"を追加したら、テストが通りました。 { "compilerOptions": { ... 省略 ... "types": [ "jes ...
pod install がうまくいかなかった時のメモ

// 以下のコマンドを実行したが、やはりエラー pod install --repo-update // Podfileを削除してしまった場合は、flutter runをすれば、Podfileが作成されます。 flutter run // 移動する cd ./ios // 以下を試してみる arch -x86_64 sudo gem install cocoapods arch -x86_64 s ...
Locations: No module for http://localhost:63458/dart_sdk.js

Environment (動作環境) Flutter (3.3.2) Error Status (エラーの発生状況) FlutterでFirebaseを利用しようとしたら、このエラーが発生した。ChromeでFlutterを表示。 Tried (試したこと) ・Flutter のバージョンを3.3.2から3.0.0に下げた。(原因はこれではなかった) Solved (原因) 色々ためしていたら、い ...
react nativeとflutterの比較

React Nativeについてはexpoを利用していることを前提にしています。expoは開発をスムーズにするツールであり、Expo Goというアプリで実機テスト動作を簡単にできるなどのメリットがあり、React Nativeの開発でexpoを使わないで開発するなどは考えられないです。 Javascript 対 Dart React NativeはJavascriptという言語で記述します。これに ...
React Native Sound のtypescript Error を修正する

Purpose (目的) React Nativeで音を出したい。しかし、サンプルの通りやると、typescript のErrorが出るので直したい。 Environment (動作環境) React Native (version 0.68.2)expo (version 45.0.8)Typescript (version 4.3.5) npm install インストールします。(npmでは ...
PayloadTooLargeError: request entity too large

Environment (動作環境) React native (version 0.68.2)expo (version 45.0.8) Cause of error (エラーの原因) The cause was that a large amount of characters were output by console.log().console.log() で出力していた文字が大量であっ ...
expoでiPhoneのエミュを立ち上げたら以下のエラー

Neact Nativeとexpoで開発を始めてから1ヶ月くらい経過したときに、iphoneのエミュを立ち上げた時に、急に以下のエラーが出た。 Started Metro Bundler › Opening on iOS... Error running `xcrun simctl help`: Xcode license is not accepted. Please run `sudo xco ...
The right-hand side of an ‘in’ expression must not be a primitive.ts(2361)のエラー

動作環境 typescript nodejsreact native 発生状況 async await を使ってAsyncStorageで保管したデータをgetして、そのgetしたデータに対して、in塩山市を使って、if文の処理をしたらタイトルのエラーが出た。getしたデータはjson型である。 エラーの原因 AsyncStorageで取得したデータの方がjsonだと思っていたが、jsonになって ...
Javascript Json配列をソートする例

メモ。sortの引数に関数を指定するというのが、よく意味がわからないがちゃんとソートしてくれる。 function compare( a, b ){ var r = 0; if( a.age < b.age ){ r = -1; } else if( a.age > b.age ){ r = 1; } return ( -1 * r ); //return r; } var myArray ...
@react-native-async-storage/async-storage を使うsample

Target (目標) @react-native-async-storage/async-storage. ← use :)@react-native-community/async-storage ← can't use anymore (I get an error) Environment (動作環境) Expo (version 45.0.8)React Native (version ...
[react native] I want to center it with the ScrollView, and I want the width to be 100%

Problem (問題点) When using ScrollView, the width is not 100%, so I tried various things. (ScrollViewを使うと、幅が100%にならなくなったりしたので、いろいろ試しました。) Operating environment (動作環境) React Native (version 0.68.2)Typescr ...
[solved] navigation.navigate Argument of type ‘string’ is not assignable to parameter of type ‘never’.ts(2769) [React Native]

Content of the error (エラーの内容) No overload matches this call. Overload 1 of 2, '(...args: never): void', gave the following error. Argument of type 'string' is not assignable to paramet ...
JavascriptでJsonの配列をソートする

コード let arr = [ {win_rate : 30, id : 1}, {win_rate : 60, id : 3}, {win_rate : 50, id : 2}, {win_rate : 80, id : 4} ]; let result_asc = arr.sort(function(a, b) { return (a.win_rate < b.win_rate) ? - ...