FBSDKCoreKit.modulemap not found in XCode with Cocoapods - xcode

I'm using Cocoapods to add FaceBook and Google platforms to my iOS app in XCode 12. Trying to build, I get the error below.
iphonesimulator/FBSDKCoreKit/FBSDKCoreKit.modulemap not found
I've run all the steps to import the pods and they seem to all be in place. In fact, the missing modulemap is here:
..ProjectName/Pods/Target Support Files/FBSDKCoreKit
So it appears XCode simply can't locate the file during the build process. I'm definitely opening the workspace created by the Pod install and not the standalone project. Any thoughts on how to make this connection?

On Xcode 12 you got the error: FBSDKCoreKit.modulemap not found because you are opening file with extension .xcproject which will causing no dependencies to your projects.
So quit Xcode and open project again by opening file with extension .xcworkspace (beer in mind you should do this while working with React Native)
Then Product > Clean and Product > Build
Cheer!

Related

ld: library not found for -lAnalytics error for expo bare workflow app on iOS

I'm getting the following error from xcode when I try to build a project I ejected from expo:
ld: library not found for -lAnalytics
I have the expo Segment package installed, and have gone through the regular ejection process, installing and configuring unimodules, and running npx install
Where should I start looking for this error? - Analytics (4.1.3) appears in my podfile.lock and I have an Analytics folder in the Library folder. I'm at a complete loss
The fix was exactly as #brentvatne said, I had opened the project via xcodeproj NOT xcworkspace. Xcode remembers your choice so on subsequent openings of xcode it had defaulted to xcodeproj.
Solution: open project with xcworkspace.

GeneratedInfoPlistDotEnv.h file is not found

I have a issue, regarding Xcode, in react-native permission file
in which GeneratedInfoPlistDotEnv.h file is not found.
How to fix this?
Already changed Info.plist Preprocessor Prefix File to
${CONFIGURATION_BUILD_DIR}/GeneratedInfoPlistDotEnv.h
but it did not solve.
issue is:
:1:10: fatal error:
'/Users/DAMAGE/Library/Developer/Xcode/DerivedData/EmployWise-fzbhiywasjfdjnfqjsfnxjbhahzs/Build/Products/GeneratedInfoPlistDotEnv.h'
file not found
Was getting this from react-native-config cocoapod. But its been fixed in v1.4.11. Was due to the older version not writing output script variables, which XCode 14 requires
This issue comes when react native is not able to link to the configuration file like .env file created in your react native environment. If you have used any react native config framework like react-native-config. then make sure this framework is linked for your iOS environment as shown below
react-native link react-native-config
If you are using react-native version >= 0.60 then follow the below steps after linking is done.
Go to ios folder and run pod install.
Next do the following:
1. Remove Derived Data from Xcode
2. Clean Build Folder
3. Build the project again
I had this problem, my solution was to change the Xcode build system from "Legacy Build System" to "New Build System" in the Workspace Settings under the File menu
In my case, I was trying to add a new target for rn-extensions-share and forgot to add all necessary libraries for that new target.

How to fix header file not found when Archive build on Xcode?

Hello I develop this iOS app use Dart language.
recently, Develop completed.
To upload an iOS app to your AppStore, need to set it up on that site.
https://developer.apple.com/
https://appstoreconnect.apple.com/
and I try Build -> Archive click on Xcode
but fail message
ios/Runner/GeneratedPluginRegistrant.m:6:9:
'device_info/DeviceInfoPlugin.h' file not found
How to fix header file not found message on Xcode?
thanks
I just discovered that this class of error can also come about when you inadvertently open the project file Runner.xcodeproj instead of the workspace file Runner.xcworkspace.
Two options
1.Using the command line build your project using "flutter create -i swift appname".
2.If you've already created a project you'll have to add 'use_frameworks!' to your podfile.
Option 2 might not be the best option because there is a cocoapods issue that causes certain packages like OneSignal will cause the app build to fail.

Can't find React native project on iOS Simulator or Xcode project

I have deleted my project on Xcode may it be .xcworkspace or .xcodeproj.
Because of that, I had to delete IOS and android folders while downgrading, updating and re-upgrading my react version to re-install IOS and android folders.
Thanks to that the emulator is working but unfortunately the project isn't present in the emulator and is still absent with Xcode. One thing to point out is that the simulator only appears when ran in the integrated terminal and nor in general terminal after cd-ing in the project folder.
Can anyone please help re-integrating the project in the emulator and on Xcode, please.
Here is the error when the emulator is running in a general terminal:
Here is the error when the emulator is running in a general terminal:
error Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
Here is the error for building the project within emulator when ran from VS code integrated terminal:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening project.xcodeproj
The process you need to follow is so similar to renaming a react native app. Basically you just need to run react-native upgrade in your root project directory. For further info you can check another question here. The instructions below explains how to create another react native project based on a copied one with a new name.
First copy the directory which your to-be-name-changed application exists. And go to your newly cloned directory.
Change the name at index.ios/android.js file which is given as a parameter to AppRegistry.
Change the name and version accordingly on package.json
Delete /ios and /android folders which are remaining from your older app.
Run $react-native upgrade to generate /ios and /android folders again.
Run $react-native link for any native dependency.
Finally run $react-native run-ios or anything you want.
Courtesy of
https://stackoverflow.com/questions/42506068/how-can-i-regenerate-ios-folder-in-react-native-project

Cocoa Pods without workspace?

I have read about a possibility to add CocoaPods to an XcodeProject without getting the xcworkspace file, instead you get a xcodeproj file that you can integrate into your current project. How can I do that? Would love to use the xcodeproj file instead of xcworkspace.. I'm programming in swift (if that makes any difference).
Yes, its possible. But, we need to do few steps to proceed.
Check this Github thread.
The below line in pod.file will not let the client integration process.
install! 'cocoapods', :integrate_targets => false
We can drag and drop the Pods.xcodeproj to the main project
Link the target dependencies and Link Binary with Libraries in Build phases.
Thats it.
You can not do this.
The CocoaPods website guide to using CocoaPods found here directs you to using the .xcworkspace it creates. Several other guides found across the Internet all direct you to use this file indicating that using the .xcodeproj file will now result in build errors.
There is simply no evidence that this is a possibility at all.
From the CocoaPods website guide on using CocoaPods:
Save your Podfile.
Run $ pod install
Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app.
More from their website:
Now you can install the dependencies in your project:
$ pod install
Make sure to always open the Xcode workspace instead of the project
file when building your project:
$ open App.xcworkspace
And from the Ray Wenderlich guide regarding using CocoaPods with Swift:
Open the project folder using Finder, and you’ll see that CocoaPods
created a new IceCreamShop.xcworkspace file and a Pods folder in which
to store all the project’s dependencies.
And from an NSHipster article on CocoaPods:
CocoaPods will create a new Xcode project that creates static library
targets for each dependency, and then links them all together into a
libPods.a target. This static library becomes a dependency for your
original application target. An xcworkspace file is created, and
should be used from that point onward. This allows the original
xcodeproj file to remain unchanged.
In older versions of cocoapods it was possible to install and update pods with the option '--no-integrate'. It allows you to create a library project, which could be imported into an existing project (read more). But this option is missing now. I've build a Xcode project for a maven-build with this option earlier. Today I've updated the pods of this project with the newest cocoapods version (1.0.0) but without the '--no-integrate' option and it still works. So eventually there is a way...

Resources