【Flutter】firebase_admob関連のエラーまとめ

Flutterにおけるfirebase_admob関連のエラーまとめの対策方法について紹介します。

【エラー】Xcodeビルド時

Failed to build iOS app
Error output from Xcode build:
↳
    objc[18792]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x203ca8188) and ?? (0x132dc02b8). One of the two will be used. Which one is undefined.
    objc[18792]: Class AMSupportURLSession is implemented in both ?? (0x203ca81d8) and ?? (0x132dc0308). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **


Xcode's output:
↳
    In file included from /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTRequestFactory.m:6:
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.h:28:4: error: expected a type
    - (GADUnifiedNativeAdView *)createNativeAd:(GADUnifiedNativeAd *)nativeAd
       ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.h:28:45: error: expected a type
    - (GADUnifiedNativeAdView *)createNativeAd:(GADUnifiedNativeAd *)nativeAd
                                                ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTRequestFactory.m:71:13: error: property 'testDevices' not found on object of type 'GADRequest *'
        request.testDevices = testDevices;
                ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTRequestFactory.m:91:15: error: property 'birthday' not found on object of type 'GADRequest *'
          request.birthday =
                  ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTRequestFactory.m:106:19: error: property 'gender' not found on object of type 'GADRequest *'
              request.gender = genderValue;
                      ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTRequestFactory.m:116:14: error: no visible @interface for 'GADRequest' declares the selector 'tagForChildDirectedTreatment:'
        [request tagForChildDirectedTreatment:childDirected.boolValue];
         ~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 errors generated.
    In file included from /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:5:
    In file included from /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.h:6:
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.h:28:4: error: expected a type
    - (GADUnifiedNativeAdView *)createNativeAd:(GADUnifiedNativeAd *)nativeAd
       ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.h:28:45: error: expected a type
    - (GADUnifiedNativeAdView *)createNativeAd:(GADUnifiedNativeAd *)nativeAd
                                                ^
    In file included from /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:5:
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.h:39:45: error: no type or protocol named 'GADInterstitialDelegate'
    @interface FLTInterstitialAd : FLTMobileAd 
                                                ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.h:44:28: error: no type or protocol named 'GADUnifiedNativeAdLoaderDelegate'
        : FLTMobileAdWithView 
                               ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:39:17: error: no known class method for selector 'configureWithApplicationID:'
      [GADMobileAds configureWithApplicationID:appId];
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:97:79: warning: implicit conversion loses integer precision: 'FLTMobileAdStatus' to 'int' [-Wshorten-64-to-32]
      NSString *statusString = (NSString *)statusToString[[NSNumber numberWithInt:_status]];
                                                          ~                       ^~~~~~~
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:211:69: error: expected a type
    - (void)adView:(GADBannerView *)adView didFailToReceiveAdWithError:(GADRequestError *)error {
                                                                        ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:242:3: error: unknown type name 'GADInterstitial'; did you mean 'GADInterstitialAd'?
      GADInterstitial *_interstitial;
      ^~~~~~~~~~~~~~~
      GADInterstitialAd
    In module 'GoogleMobileAds' imported from /Users/github/AAAA/flutter/basenum/ios/Pods/Headers/Public/Firebase/Firebase.h:125:
    /Users/github/AAAA/flutter/basenum/build/ios/Debug-iphonesimulator/XCFrameworkIntermediates/GoogleMobileAds/GoogleMobileAds.framework/Headers/GADInterstitialAd.h:28:12: note: 'GADInterstitialAd' declared here
    @interface GADInterstitialAd : NSObject 
               ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:271:35: error: expected a type
    - (void)interstitialDidReceiveAd:(GADInterstitial *)ad {
                                      ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:278:23: error: expected a type
    - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error {
                          ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:278:73: error: expected a type
    - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error {
                                                                            ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:284:40: error: expected a type
    - (void)interstitialWillPresentScreen:(GADInterstitial *)ad {
                                           ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:288:40: error: expected a type
    - (void)interstitialWillDismissScreen:(GADInterstitial *)ad {
                                           ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:292:39: error: expected a type
    - (void)interstitialDidDismissScreen:(GADInterstitial *)ad {
                                          ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:296:43: error: expected a type
    - (void)interstitialWillLeaveApplication:(GADInterstitial *)ad {
                                              ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:255:21: error: unknown receiver 'GADInterstitial'; did you mean 'GADInterstitialAd'?
      _interstitial = [[GADInterstitial alloc] initWithAdUnitID:adUnitId];
                        ^~~~~~~~~~~~~~~
                        GADInterstitialAd
    In module 'GoogleMobileAds' imported from /Users/github/AAAA/flutter/basenum/ios/Pods/Headers/Public/Firebase/Firebase.h:125:
    /Users/github/AAAA/flutter/basenum/build/ios/Debug-iphonesimulator/XCFrameworkIntermediates/GoogleMobileAds/GoogleMobileAds.framework/Headers/GADInterstitialAd.h:28:12: note: 'GADInterstitialAd' declared here
    @interface GADInterstitialAd : NSObject 
               ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:255:44: error: no visible @interface for 'GADInterstitialAd' declares the selector 'initWithAdUnitID:'
      _interstitial = [[GADInterstitial alloc] initWithAdUnitID:adUnitId];
                       ~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:256:17: error: property 'delegate' not found on object of type 'GADInterstitialAd *'
      _interstitial.delegate = self;
                    ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:258:18: error: no visible @interface for 'GADInterstitialAd' declares the selector 'loadRequest:'
      [_interstitial loadRequest:[factory createRequest]];
       ~~~~~~~~~~~~~ ^~~~~~~~~~~
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.m:313:3: error: unknown type name 'GADUnifiedNativeAdView'; did you mean 'GADNativeAdView'?
      GADUnifiedNativeAdView *_nativeAd;
      ^~~~~~~~~~~~~~~~~~~~~~
      GADNativeAdView
    In module 'GoogleMobileAds' imported from /Users/github/AAAA/flutter/basenum/ios/Pods/Headers/Public/Firebase/Firebase.h:125:
    /Users/github/AAAA/flutter/basenum/build/ios/Debug-iphonesimulator/XCFrameworkIntermediates/GoogleMobileAds/GoogleMobileAds.framework/Headers/GADNativeAd.h:114:12: note: 'GADNativeAdView' declared here
    @interface GADNativeAdView : UIView
               ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    1 warning and 20 errors generated.
    In file included from /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.m:5:
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.h:28:4: error: expected a type
    - (GADUnifiedNativeAdView *)createNativeAd:(GADUnifiedNativeAd *)nativeAd
       ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.h:28:45: error: expected a type
    - (GADUnifiedNativeAdView *)createNativeAd:(GADUnifiedNativeAd *)nativeAd
                                                ^
    In file included from /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.m:9:
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.h:39:45: error: no type or protocol named 'GADInterstitialDelegate'
    @interface FLTInterstitialAd : FLTMobileAd 
                                                ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTMobileAd.h:44:28: error: no type or protocol named 'GADUnifiedNativeAdLoaderDelegate'
        : FLTMobileAdWithView 
                               ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.m:138:16: warning: 'kGADAdSizeSmartBannerPortrait' is deprecated: Use GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth. [-Wdeprecated-declarations]
          adSize = kGADAdSizeSmartBannerPortrait;
                   ^
    In module 'GoogleMobileAds' imported from /Users/github/AAAA/flutter/basenum/ios/Pods/Headers/Public/Firebase/Firebase.h:125:
    /Users/github/AAAA/flutter/basenum/build/ios/Debug-iphonesimulator/XCFrameworkIntermediates/GoogleMobileAds/GoogleMobileAds.framework/Headers/GADAdSize.h:126:5: note: 'kGADAdSizeSmartBannerPortrait' has been explicitly marked deprecated here
        GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth.");
        ^
    In module 'GoogleMobileAds' imported from /Users/github/AAAA/flutter/basenum/ios/Pods/Headers/Public/Firebase/Firebase.h:125:
    /Users/github/AAAA/flutter/basenum/build/ios/Debug-iphonesimulator/XCFrameworkIntermediates/GoogleMobileAds/GoogleMobileAds.framework/Headers/GoogleMobileAdsDefines.h:25:56: note: expanded from macro 'GAD_DEPRECATED_MSG_ATTRIBUTE'
    #define GAD_DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                           ^
    /Users/XXXX/.pub-cache/hosted/pub.dartlang.org/firebase_admob-0.11.0+1/ios/Classes/FLTFirebaseAdMobPlugin.m:140:16: warning: 'kGADAdSizeSmartBannerLandscape' is deprecated: Use GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth [-Wdeprecated-declarations]
          adSize = kGADAdSizeSmartBannerLandscape;
                   ^
    In module 'GoogleMobileAds' imported from /Users/github/AAAA/flutter/basenum/ios/Pods/Headers/Public/Firebase/Firebase.h:125:
    /Users/github/AAAA/flutter/basenum/build/ios/Debug-iphonesimulator/XCFrameworkIntermediates/GoogleMobileAds/GoogleMobileAds.framework/Headers/GADAdSize.h:131:5: note: 'kGADAdSizeSmartBannerLandscape' has been explicitly marked deprecated here
        GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth");
        ^
    In module 'GoogleMobileAds' imported from /Users/github/AAAA/flutter/basenum/ios/Pods/Headers/Public/Firebase/Firebase.h:125:
    /Users/github/AAAA/flutter/basenum/build/ios/Debug-iphonesimulator/XCFrameworkIntermediates/GoogleMobileAds/GoogleMobileAds.framework/Headers/GoogleMobileAdsDefines.h:25:56: note: expanded from macro 'GAD_DEPRECATED_MSG_ATTRIBUTE'
    #define GAD_DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                           ^
    2 warnings and 4 errors generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
    warning: Skipping duplicate build file in Copy Bundle Resources build phase: /Users/XXXX/Downloads/GoogleService-Info.plist (in target 'Runner' from project 'Runner')

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
【Flutter入門】iOS、Android、Windowsアプリ開発
Flutterによるアプリ開発について入門者向けに紹介します。

コメント

タイトルとURLをコピーしました