Flutterでfirebase_admobのライブラリを0.11.0+1にアップグレードしたところ、たくさんエラーが出て起動できなくなった。
下記のようなもの。
error: expected a type
- (GADUnifiedNativeAdView *)createNativeAd:(GADUnifiedNativeAd *)nativeAd
error: expected a type
- (GADUnifiedNativeAdView *)createNativeAd:(GADUnifiedNativeAd *)nativeAd
error: property 'testDevices' not found on object of type 'GADRequest *'
request.testDevices = testDevices;
error: property 'birthday' not found on object of type 'GADRequest *'
request.birthday =
error: property 'gender' not found on object of type 'GADRequest *'
request.gender = genderValue;
error: no visible @interface for 'GADRequest' declares the selector 'tagForChildDirectedTreatment:'
[request tagForChildDirectedTreatment:childDirected.boolValue];
詳しくはわからないけど依存関係がうまくいっていないっぽい。解決方法は下記に書かれていた。
https://github.com/FirebaseExtended/flutterfire/issues/4931
具体的にはPodfileの中に下記のGoogle-Mobile-Ads-SDKの行を追記するらしい。
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# Try adding this
pod 'Google-Mobile-Ads-SDK', '~> 7.69.0'
end
あとは
* ios/Pods削除
* ios/Podfile.lock削除
* flutter clean実行
このあとデバッグしたら起動できるようになった。できない場合は引き続きエラーログを見て色々指示通りにしてみるしかない。ちなみにこのバージョンでリリースまでまだしてないので本当にこれでOKかは不明。
Crieitは誰でも投稿できるサービスです。 是非記事の投稿をお願いします。どんな軽い内容でも投稿できます。
また、「こんな記事が読みたいけど見つからない!」という方は是非記事投稿リクエストボードへ!
こじんまりと作業ログやメモ、進捗を書き残しておきたい方はボード機能をご利用ください。
ボードとは?
コメント