Unity iOS project 'FBSDKShareKit/FBSDKShareKit.h' file not found - ios

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.

Related

Cannot find type 'SKAdImpression' in scope

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.

Firebase analytics and other modules on Apple M1 chip

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.

framework not found .xcframework

I have created a .xcframework using Xcode 11.0 command line. And it is working fine if I simply drag and drop it on any Xcode project above Xcode 11.0. I have tried on Xcode 11.0, 11.1, 11.2.1 and it is working perfectly on them. Now I am trying to use it through Cocoapods. To do so I have created podspec file given the local path of the framework. It is installing the pods successfully as well into the project. But now when I am trying to build the project it is getting failed by saying
ld: framework not found RandomNames.xcframework
I am not sure where the problem is, because it is working fine if we use directly dragging into the project.
I have checked the framework search path, tried to pod disintegrate, clean and install them again but no success.
This is what error I am getting:
and below is my .podspec file which I am using:
It looks like they've added support for xcframeworks now and released a beta version (CocoaPods 1.9 Beta).
Try giving it a shot! :)

React Native Podfile IOS Installation Error

My friend and I have been working in a react-native project for a company where he is working on a windows for Android and I am working on IOS part beside Google Maps and PlacesPicker.
But now after my friend have added googleSignin I try to add it to my Podfile for IOS and install the pod there is a error which is stopping me to work on it any more.
[!] The `Project [Release]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-Project/Pods-Project.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Thank you in advance.
Go to Xcode project and select Build settings.
Scroll down and find Library Search Path dropdown under 'Search Paths' section.
In Release mode use $(inherited)in the beginning of the path string.
Thanks for your tips #csath you really helped me to dig down the path file on my xcode .But the issue is actually resolved by #SamirChenon tricks which I applied to every path. Additionally, I also removed spaces between my pod packages in inside podfile and pod install.
Thank you all for helping :D

Getting errors when adding CocoaPods to an existing project

My project,'Shag iBeacon' contains frameworks:
Bolts.framework,
Parse.framework,
AudioToolbox.framework,
CFNetwork.framework,
MobileCoreServices.framework,
QuartzCor‌​e.framework,
Security.framework
StoreKit.framework,
SystemConfiguratinon.framework,
​Accounts.framework,
Social.framework,
AdSupport.framework,
CoreLocation.framework,
Co‌​reBluetooth.framework,
Foundation.framework,
CoreGraphics.framework and
UIKit.framework.
I added CocoaPods to this existing Project and added the parse library to project using the statement: pod 'Parse'.I opened Shag iBeacon.xcworkspace and Icompiled the project But Iam getting an error as
The file “Pods-Shag iBeacon-Bolts-Private.xcconfig” couldn’t be opened because there is no such file.
(I have attatched 2 screen shots of my projet navigator)
Could someone explain me how to solve this? Thanks in advance...
My experience is on an Ionic project (therefore it may be different from yours a bit). I installed the lasted version and it appears ios projects now have some unique requirements. Googling around led me to upgrade cocoapods first then switch to an iOS platform directory (the one that has the project definition files) and run pod install.
I don't know who you'd do on XCode but from the terminal if you just run pod install (after making sure you have the latest cocoapods installed i.e gem install cocoapods) you should be fine.

Resources