I'm using the Firebase and the SDWebImageSwiftUI module in my SwiftUI 2 app with Xcode 12.3 and Cocoapod 1.10.0 on my Apple M1 MacBook Pro.
As long as I don't integrate the Firebase Analytics module via Cocoapod the app works fine but when I integrate it, I get the same error as the guy here: Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64. His solution also works for me (exclude arm64 architecture for the project and pods).
However now the SDWebImageSwiftUI module (included via swift package manager) is complaining "Could not find module 'SDWebImageSwiftUI' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator". If I include the module via Cocoapod then the compiler says "No such module "SDWebImageSwiftUI".
Does anyone of you has an idea on what I could do?
Any help is much appreciated
From the instructions at https://github.com/firebase/firebase-ios-sdk/blob/master/AppleSilicon.md:
When specifying which version of Firebase you'd like in your Podfile, append -M1 to the version. See the following examples:
Explicitly require the special M1 tagged Firebase version, locked to the exact version. Note
that due to the version scheme, you're required to update this manually for each release otherwise
you will revert to the official release (ex. 7.2.0 instead of 7.2.0-M1).
pod 'Firebase/Analytics', '7.2-M1'
Do the same for any other Firebase pod used.
pod 'Firebase/Database', '7.2-M1'
Remember: now you need to manually add -ObjC to avoid a runtime crash. This CocoaPods issue has been fixed in CocoaPods/CocoaPods#10234 and is merged for the upcoming CocoaPods 1.10.1 patch release.
Checking the option "Open with Rosetta" (as in the screenshot below) helped me to solve this problem. After the error disappears, you can switch back and open Xcode without Rosetta.
You no longer need to append M1 according to the updates from Firebase. You may check it on the link for further instructions.
Starting with Firebase 7.5.0, Firebase supports Apple Silicon Macs via CocoaPods. CocoaPods 1.10.0 is required.
The special M1 versions required for FirebaseAnalytics support for versions 7.2.0 through 7.4.0 are no longer necessary.
https://github.com/firebase/firebase-ios-sdk/blob/master/AppleSilicon.md
Try this:
In your root
sudo arch -x86_64 gem install ffi
cd to your project folder and
arch -x86_64 pod install
Please take a look at this. https://stackoverflow.com/a/68037246/4862289
Go to Application folder -> Right click on Terminal App -> Get Info
Tick Open with Rosetta option.
try pod install now.
Related
After updating XCode recently, my project failed (it was running properly prior to the update). The error showed up on a line of code which imported a Firebase pod:
import FirebaseFirestoreSwift
and the error reads: "Module compiled with Swift 5.5.1 cannot be imported by Swift 5.6.1"
First thing to check, is if you are running XCode with an M1-based Mac. If so, make sure to do a pod update. For M1 this is different than just the simple "pod update" command, as follows:
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
see reference: https://stackoverflow.com/a/70238542/11132995
Next, with XCode open, make sure it's selected such that you see "XCode" to the right of your 🍎 symbol on MacOS's menu up top, and then select the PRODUCT menu and click on 'Clean Build Folder'. see Figure One.
Let this run, and you should advance down the line for your errors. You may still encounter another firebase pods error, but that probably has to do with changing something in your podfile, like FirebaseFirestoreSwift may be a different version required such as '> 7.0-beta' or '8.1.0'. Check with Firebase.
(updated): More on Firebase
Your project may run with a new error such as "FirebaseCore could not be found".
Run the command-- arch -x86_64 pod update on Terminal.
You may see some Firebase pods updating to the latest builds-- see my example, ie), below. See FIGURE TWO for what it might look like when it's done. Your numbers will likely be higher, as time passes from the date of this post (July 2022)
ie)
Installing BoringSSL -GRPC 0.0.24 (was 0.0.7)
Installing Firebase 9.2.0 (was 8.10.0)
Installing FirebaseFirestoreSwift 9.2.0 (was 8.10.0-beta)
etc.... (this could be a long list of Firebase pods depending on your project, and it could take awhile, so don't run your project until it completes-- go get a Lebanon Bologna sandwich)
This update might even fix a few other errors in your project, related to your console prints (when running your project), if you're lucky and Google and Apple are on top of things.
(update 2): If things still not working, or more Firebase errors, try this solution:
arch -x86_64 pod deintegrate
arch -x86_64 pod install
'deintegrate' separates your project from the pod files (like Firebase SDKs). When you run pod install, the installer runs your Podfile again; thus, it INTEGRATES Firebase and your project again. Think of it like deleting the references to SDKs in your project (but it doesn't delete your pod files which are stored on your Mac). Deintegrate is like deleting a tether/link/call which sits in your project and directs your project to grab the Firebase files.
(if you've already run pod update, this should be quicker)
source: https://stackoverflow.com/a/70032985/11132995
update pod 'FirebaseFirestoreSwift', '9.2.0-beta'
I'm trying to implement MoPub into my Swift app, but in some of the files that are provided by the MoPub pod there are errors saying Cannot find type 'SKAdImpression' in scope. I also cannot import MoPub in my own documents. I tried running pod update restarting xcode, and making sure I am using the .xcworkspace file
Edit: I just re-read the apple documentation, and noticed that it says SKAdImpression is an iOS 14.5+ feature. The version of Xcode I have is for iOS 14.4, so it makes sense as to why it cannot be found. My only concern is, does this mean that my app will only work on iOS 14.5+?
Edit 2: My mac does not support the latest MacOS which is required for the latest Xcode for 14.5. Is there anything I can do to get MoPub working anyway?
The version of Xcode I have is for iOS 14.4
My mac does not support the latest MacOS
Bad news is that is there is no other way around this error, as far as I can see.
What did not help:
Removing the version, pod 'mopub-ios-sdk' and running pod install of pod update again.
Cleaning Build Folder.
Cleaning the /DerivedData folder.
What did help:
Updating Xcode to the 12.5 version.
Take the version out.
pod 'mopub-ios-sdk'
run pod install
Alternatively you can follow this from their guide:
simply import MoPubSDK/MoPub-Bridging-Header.h to your project and
ensure that the Objective-C Bridging Header build setting under Swift
Compiler - Code Generation has a path to the header.
They also have a sample program, take a look at that as well. You can find it here:
https://github.com/mopub/mopub-ios-sdk/tree/master/Canary
Also, make sure you have the project closed out before you run pod install. I have seen issues in the past when this happens.
I use Unity 2019.3.0f3 for export Unity to iOS as Framework.
And when I open exported iOS project I get the issue
but I can navigate to this header use "Cmd+click".
I googled and tried almost all solutions which I could find
I tried set home directory for Framework Search Path to '$(HOME)/Documents/FacebookSDK'
also tried set FBSDKShareKit.Framework as embeddedFramework and Pods install. Nothing helped
How can I figure out it?
I solved it temporarily by downgrading to Facebook SDK version 7.15.1 & removed #include "RegisterMonoModules.h" from FBunityInterface.h
I solved it by changing it as follows. No need to downgrade Facebook SDK.
My Envrionment:
Unity v2020.1.6f
Facebook SDK v9.1.0
XCode v12.5
Solution:
Goto Unity --> Play Service Resolver -->
iOS Resolver --> Settings --> Cocoapods Integration: Select XCode Project - Add Cocoapods to XCode project
Reason:
Because its default setting is to add Cocoapods to the XCode workspace. This is the cause of this issue due to the missing FBSDKShareKit framework.
If you set up Add Cocoapods to XCode project properly, you will see Pods.proj with FBSDKShareKit framework imported into XCode Project.
Remember you need to install cocoapods properly on your Mac.
Otherwise, Pods.proj won't be imported into your XCode Project.
If not, run
sudo gem install cocoapods
Then check it, run
pod
You should be able to see the command's description.
Hope this will be helpful for you.
I got it working when building on Mac using 2019.2.17 + pod install and exporting from the xcode workspace file, not the xcodeproj file.
I've solved it just downgrade FacebookSDK to 7.16.1 and update Firebase SDK for Unity.
I was running my simulator and in my debug console, I got the following message:
New version of Google Maps SDK for iOS available
How do I update to the latest version? I tried to do sudo gem pod install, but it didn't work.
Thanks.
Follow these instructions to upgrade an existing project to the most recent version of the Google Maps SDK for iOS.
If you previously installed the Google Maps SDK for iOS from a zip file containing a static framework:
Remove all references to the previous framework from your Xcode project.
Follow the instructions above to install the Google Maps SDK for iOS using CocoaPods.
Make any necessary changes as a result of the upgrade. See the [release notes][3] for a list of the changes in each release.
Clean and rebuild your project by selecting Product > Clean and then Product > Build.
If you previously installed the Google Maps SDK for iOS from the Google-Maps-iOS-SDK pod:
Change your pod name to GoogleMaps.
Run pod install.
Make any necessary changes as a result of the upgrade. See the release notes for a list of the changes in each release.
Clean and rebuild your project by selecting Product > Clean and then Product > Build.
If you previously installed the Google Maps SDK for iOS from the GoogleMaps pod:
Check your Podfile for any version limiter, and ensure you remove or update the version to ensure you get the version you need. See the release notes for a list of version numbers.
Run pod update.
Make any necessary changes as a result of the upgrade. See the release notes for a list of the changes in each release.
Clean and rebuild your project by selecting Product > Clean and then Product > Build.
Note: Versions 1.9.2 and earlier of the Google Maps SDK for iOS were available as a zip file containing a static framework. There was also the option to install recent versions from a CocoaPods pod. From version 1.10.0 onwards, the Google Maps SDK for iOS is available for installation only via CocoaPods.
sudo gem pod install will install Cocoapods.
What you need to do is update the pods in your project.
You can do it by executing the command pod update or pod install in the folder in which your Podfile is located.
If after pod install nothing updated, run pod update.
Just follow the below steps to update any SDK which got installed using CocoaPods:
Open terminal
Type cd /yourProjectFolderPath and press enter
Type pod update POD NAME and press enter
E.g: pod update GoogleMaps
That's all. A new version of the SDK will be updated in your project.
This was building previously but isn't anymore. I updated cocoapods and pulled new data in with pod update but still can't build my iOS 9.0 app anymore:
/Users/cdub/Developer/AppName/Pods/Headers/Public/
AWSCognito/AWSCognitoSyncService.h:198:4:
Type arguments cannot be applied to non-parameterized class 'AWSTask'
Why is this happening?
The version of AWSCore and AWSCognito need to match. It looks like your AWSCognito is newer than AWSCore. How did you get AWSCognito and AWSCore? Both through CocoaPods? You need to use pod update when updating the pods instead of pod install.
If you keep encountering the issue, you should delete Podfile.lock and Pods/ and then run pod install to cleanly install the SDK. AWS Mobile SDK iOS Developer Guide has more information about how to setup the SDK.