How to fix header file not found when Archive build on Xcode? - 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.

Related

FBSDKCoreKit.modulemap not found in XCode with Cocoapods

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!

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.

Flutter library not found for -ldevice_info, can't archive the ios app with xcode

when I try to archive the app or run in a real device, I always get below errors:
ld: library not found for -ldevice_info
clang: error: linker command failed with exit code 1 (use -v to see invocation)
but if I just run in a simulator, everything is ok, if I try to remove the device_info package, then it will also show another package not found:(
I am using the latest flutter dev sdk, and I have setup a valid iOS developer certificates.
Thanks!
It seems that the solution here in this SO post as mentioned in the comment works for this case:
In new projects, in the iOS part is necessary to adjust a few
parameters, such as signing, and that you can only do in Xcode.
So, try to open the iOS project with Xcode and try to build it from
there. You'll see better warning and error messages there, specially
regarding signing.
You can open Xcode and locate your project ios folder, or:
cd yourproject/ios
open -a Xcode .
Then select Product > Run in the menu.
Also, this GitHub post discussion could also be a possible reason for other cases. Try to check the following:
I was able to successfully archive with your pubspec.yaml.
Can you confirm you opened ios/Runner.xcworkspace and NOT ios/Runner.xcodeproj? See Better handle case where a developer
opens Runner.xcodeproj instead of Runner.xcworkspace
#10770.
Did you run flutter build ios before you Archived? See https://flutter.dev/docs/deployment/ios#create-a-build-archive.

'hello/Hello.h' file not found - Trying to build/run iOS gomobile Hello app

I am building the gomobile Hello example app, but am running into the following problem: When trying to build and run the app after opening it in Xcode (7.1), I get the error 'hello/Hello.h' file not found'
From what I can tell, Hello.h is in fact in the hello folder of the native directory.
Following this discussion on Github, it seems like this is due to a recent change in the way Xcode 7 updates paths for the headers.
The proposed solution is to check Copy items if needed when importing the framework:
I can confirm that this fixes the issue. But note that you would then need to re-import the framework every time you make changes and build the go code.

Parse/Parse.h file not found - Xcode 6

I created project with cordova and ionic. I installed a Parse plugin (http://plugins.cordova.io/#/package/com.parse.cordova.core.pushplugin).
When I open my project with Xcode I have an error:
Parse/Parse.h file not found
I tried a lot of solutions found on stackoverflow, but none corrects my problem.
Framework Search Paths
"MyApp/Plugins/com.parse.cordova.core.pushplugin"
Try this plugin, it has updated Parse SDK framework.
https://github.com/avivais/phonegap-parse-plugin
Install the plugin like this (do not use Installation method url from README) -
phonegap plugin add https://github.com/avivais/phonegap-parse-plugin.git
OR
cordova plugin add https://github.com/avivais/phonegap-parse-plugin.git
I am having the same issue and posted it on GitHub (https://github.com/avivais/phonegap-parse-plugin/issues/49).
My temporary workaround is:
$ cordova plugin add https://github.com/avivais/phonegap-parse-plugin
$ ionic platform rm ios
$ ionic platform add ios
XCode complains about the Parse.h file not found. It is in fact there. All I need to do is:
open the project in XCode,
go to General > Linked Frameworks and libraries
remove, then add the Parse.framework from the same directory
build
Actually, a better workaround is to make the Platform search path recursive, like so:
https://stackoverflow.com/a/20856145/3889068

Resources