FC2ブログ
    03 «1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.» 05

    ハルシオンシステムの気ままBlog

    株式会社ハルシオンシステムのメンバーが送る、UnityやらJavaやらの技術的話題から、自社開発のアプリの宣伝とかとかのブログです。ほんと気ままにいきたいと思います。更新日は毎週 月 木でっす!

     

    【ハルシオンブログ】UnityプロジェクトにFirebaseとAdmobを入れたらビルドが通らない!だれか助けて!(悲痛な叫び 

    こんにちは。坂内っす。
    じめじめした日が続きますね。
    もう梅雨きたんですか?まだですよね。
    早くこのじめじめした世界からおさらばしたいところです。

    さて、ここ1週間IOSのビルドではまってます。

    <環境>
    ●MacBook Air
    ●M1ではない
    ●Big Sur 11.1
    ●Unity 2020.1.0f1


    はまってる内容としてはこんな感じ。
    https://shirokurohitsuji.studio/2021/05/02/googlemobileads-h-file-not-found-xcode-fail/

    まぁ前提条件としてUnityビルド時に「.xcworkspace」ができないのがまずは問題ですね。

    はい、そんなこんなで検索するとこんな記事もヒットします。

    https://qiita.com/noprops/items/f997a438fabb64c15f10

    cocoapodsがうまく入ってないようです。

    ということで、ここに書いてあることは10回くらいやりました。

    ほかにもいろんな記事がありますよ。
    大体目についたのはやりました。

    「.xcworkspace」ができない!

    Unityでのビルド時にこんなエラーが出ます。


    iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.

    After the failure, "pod repo update" was executed and succeeded. "pod install" was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: https://guides.cocoapods.org/using/troubleshooting.html for potential solutions.

    pod install output:

    Analyzing dependencies
    [!] CocoaPods could not find compatible versions for pod "FirebaseCore":
    In Podfile:
    Firebase/Analytics (= 6.24.0) was resolved to 6.24.0, which depends on
    Firebase/Core (= 6.24.0) was resolved to 6.24.0, which depends on
    Firebase/CoreOnly (= 6.24.0) was resolved to 6.24.0, which depends on
    FirebaseCore (= 6.7.0)

    Firebase/Analytics (= 6.24.0) was resolved to 6.24.0, which depends on
    Firebase/Core (= 6.24.0) was resolved to 6.24.0, which depends on
    FirebaseAnalytics (= 6.5.0) was resolved to 6.5.0, which depends on
    FirebaseCore (~> 6.7)

    CocoaPods could not find compatible versions for pod "GoogleAppMeasurement":
    In Podfile:
    Firebase/Analytics (= 6.24.0) was resolved to 6.24.0, which depends on
    Firebase/Core (= 6.24.0) was resolved to 6.24.0, which depends on
    FirebaseAnalytics (= 6.5.0) was resolved to 6.5.0, which depends on
    GoogleAppMeasurement (= 6.5.0)

    Google-Mobile-Ads-SDK (~> 8.2) was resolved to 8.4.0, which depends on
    GoogleAppMeasurement (~> 7.0)


    pod repo update output:

    Updating spec repo `cocoapods`
    $ /usr/bin/git -C /Users/xxxxx/.cocoapods/repos/cocoapods fetch origin --progress
    $ /usr/bin/git -C /Users/xxxxx/.cocoapods/repos/cocoapods rev-parse --abbrev-ref HEAD
    master
    $ /usr/bin/git -C /Users/xxxxx/.cocoapods/repos/cocoapods reset --hard origin/master
    HEAD is now at ff691bf4d471 [Add] NendSDK_iOS_MoPub_CustomEvent 7.0.5.0

    remote: Enumerating objects: 3263, done.
    remote: Counting objects: 0% (1/3263)
    remote: Counting objects: 1% (33/3263)
    remote: Counting objects: 2% (66/3263)
    remote: Counting objects: 3% (98/3263)
    remote: Counting objects: 4% (131/3263)
    remote: Counting objects: 5% (164/3263)
    remote: Counting objects: 6% (196/3263)
    remote: Counting objects: 7% (229/3263)
    remote: Counting objects: 8% (262/3263)
    remote: Counting objects: 9% (294/3263)
    remote: Counting objects: 10% (327/3263)
    remote: Counting objects: 11% (359/3263)
    remote: Counting objects: 12% (392/3263)

     ・
     ・
     ・
     ・


    ????
    さてなんでしょうね?

    色々調べていると、ここで「pod setup」>「pod install」をするとxcworkspaceができるとかなんとか。

    pod setupは正常に完了します。

    pod installはこんな感じになります。


    xxxxx@AAAMacBook-Air AAA % pod install
    Analyzing dependencies
    [!] CocoaPods could not find compatible versions for pod "FirebaseCore":
    In Podfile:
    Firebase/Analytics (= 6.24.0) was resolved to 6.24.0, which depends on
    Firebase/Core (= 6.24.0) was resolved to 6.24.0, which depends on
    Firebase/CoreOnly (= 6.24.0) was resolved to 6.24.0, which depends on
    FirebaseCore (= 6.7.0)

    Firebase/Analytics (= 6.24.0) was resolved to 6.24.0, which depends on
    Firebase/Core (= 6.24.0) was resolved to 6.24.0, which depends on
    FirebaseAnalytics (= 6.5.0) was resolved to 6.5.0, which depends on
    FirebaseCore (~> 6.7)

    CocoaPods could not find compatible versions for pod "GoogleAppMeasurement":
    In Podfile:
    Firebase/Analytics (= 6.24.0) was resolved to 6.24.0, which depends on
    Firebase/Core (= 6.24.0) was resolved to 6.24.0, which depends on
    FirebaseAnalytics (= 6.5.0) was resolved to 6.5.0, which depends on
    GoogleAppMeasurement (= 6.5.0)

    Google-Mobile-Ads-SDK (~> 8.2) was resolved to 8.4.0, which depends on
    GoogleAppMeasurement (~> 7.0)



    バージョンがうんぬん。

    Unityビルドをした後に、ビルドされたフォルダにある「Podfile」を変更。


    source 'https://github.com/CocoaPods/Specs.git'
    source 'https://github.com/CocoaPods/Specs'
    platform :ios, '11.0'

    target 'UnityFramework' do
    pod 'Firebase/Analytics', '6.24.0'
    pod 'Firebase/Core', '6.24.0'
    pod 'Google-Mobile-Ads-SDK', '~> 8.2'
    end
    target 'Unity-iPhone' do
    end
    use_frameworks!



    ↓↓↓↓↓↓↓↓↓↓↓↓↓↓


    source 'https://github.com/CocoaPods/Specs.git'
    source 'https://github.com/CocoaPods/Specs'
    platform :ios, '11.0'

    target 'UnityFramework' do
    pod 'Firebase/Analytics'
    pod 'Firebase/Core'
    pod 'Google-Mobile-Ads-SDK'
    end
    target 'Unity-iPhone' do
    end
    use_frameworks!



    それぞれのFrameworkのバージョンを消してみました。

    この状態でpod install


    xxxxx@AAAMacBook-Air AAA % pod install
    Analyzing dependencies
    Downloading dependencies
    Installing Firebase (8.0.0)
    Installing FirebaseAnalytics (8.0.0)
    Installing FirebaseCore (8.0.0)
    Installing FirebaseCoreDiagnostics (8.0.0)
    Installing FirebaseInstallations (8.0.0)
    Installing Google-Mobile-Ads-SDK (8.5.0)
    Installing GoogleAppMeasurement (8.0.0)
    Installing GoogleDataTransport (9.0.0)
    Installing GoogleUserMessagingPlatform (2.0.0)
    Installing GoogleUtilities (7.4.1)
    Installing PromisesObjC (1.2.12)
    Installing nanopb (2.30908.0)
    Generating Pods project
    Integrating client project

    [!] Please close any current Xcode sessions and use `Unity-iPhone.xcworkspace` for this project from now on.
    Pod installation complete! There are 3 dependencies from the Podfile and 12 total pods installed.



    成功!?

    無事「.xcworkspace」ができました!

    xcworkspaceからXcodeを開きビルド!!


    ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/xxxxx/AAA/AAAforios/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
    Undefined symbols for architecture arm64:
    "_GADURequestInterstitial", referenced from:
    _Externs_GADURequestInterstitial_m77D58C1021B0E1A9320F3326857B18C58380315E in GoogleMobileAds.iOS.o
    (maybe you meant: _Externs_GADURequestInterstitial_m77D58C1021B0E1A9320F3326857B18C58380315E)
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)


    こんなエラーがでました・・・・・

    ぐぬぬぬぬぬう

    さて私はここからどうすればよいでしょうか・・・・??

    IOSビルド詳しい方教えてくだせー!

    ほんとIOSビルドむk(ry

    何がいけないのだろうか??

    ってことで、またビルドに戻ります・・・・あでゅ~ノシ

    Category: 開発日記(Unity)

    tb 0 : cm 2   

    コメント

    初めまして。
    最初に引用していただいた記事を書いたものなのですが、今回のエラーはその記事のものとは少し違って、最新のSDKとUnity2020を使うと起きるエラーのようです。
    まだ試してはいないのですが、こちらのスレッドに回避策がありました。
    https://github.com/googleads/googleads-mobile-unity/issues/1616
    どちらかのバージョンを変えるか(2021を使うと別のエラーが起きるのですが、そちらの方が自分でも直しやすくて、中の人も動いているようです。https://github.com/googleads/googleads-mobile-unity/issues/1613)、その回避策を使うか、もう少し待つかと言う感じだと思います。

    志麻ひぬこ #8go/ZnYY | URL | 2021/05/25 18:23 [edit]

    Re: タイトルなし

    志麻ひぬこ様
    初めまして!情報ありがとうございます!
    SDK6のバグのようですね!

    5.4.0にしてAdmobまではビルド通りました!
    あとはFirebaseのほうのバージョン不一致のエラーを何とかしなくてはという感じです・・・
    Podfileのバージョン消すだけでいいのか謎です・・・・

    株式会社ハルシオンシステム #- | URL | 2021/05/26 10:13 [edit]

    コメントの投稿

    Secret

    トラックバック

    トラックバックURL
    →http://halcyonsystemblog.jp/tb.php/796-e7a12151
    この記事にトラックバックする(FC2ブログユーザー)