简体   繁体   中英

Transfer to Apple M1 Xcode shows an error "'FirebaseCore/FirebaseCore.h' file not found" and "Could not build Objective-C module 'Firebase'"

There is a fairly common problem in my Xcode project. I'm using Firebase and project perfectly works with Xcode 11 on Intel i5, but with Xcode 13 (Swift 5) on Apple M1 there are 2 dramatic errors:

  • 'FirebaseCore/FirebaseCore.h' file not found

找不到“FirebaseCore/FirebaseCore.h”文件

  • Could not build Objective-C module 'Firebase' 无法构建 Objective-C 模块“Firebase”

My Pods:

在此处输入图像描述

So, what I tried:

  1. Quite xcode Delete "ProjectName.xcworkspace", "Podfile.lock" and "Pods". Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData (Command + Shift + G in finder) Run "pod install" from terminal. Open "ProjectName.xcworkspace".

Error: Could not build Objective-C module 'Firebase' with Swift 5

  1. Adding arm64 to Excluded Architectures for the main project AND for the Pods project

在此处输入图像描述

在此处输入图像描述

Xcode 12: build Error on FIRAnalyticsConnector

And many other options. But neither one is suitable for me. What should I try?

  1. $ pod deintegrate
  2. $ pod clean
  3. open the terminal with using Rosetta
  4. $ pod install

My friend try this. Add this at the end of podfile and re-install cocoapods. Took me and the team hours but we eventually figured this out.

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

I had the same issue when transferring Xcode to M1 pro Mac. Though, none of the answers above was not working for me, I found out that my googleService.info plist was, for some reason, never transferred to the new Mac. I download it from firebase console and it started to work. Hoping this might be help someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM