I am trying to run my application on my iPhone and receiving the following error. It is working fine on Simulator and release builds are also getting built.
error build: Build input file cannot be found: '/Users/mdjavedakhtar/Library/Developer/Xcode/DerivedData/baa-ejkeyxidrdwrgyctzidcxyrfemfc/Build/Products/Debug-iphoneos/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
Faced with the same issue after updating macOS to 13.2 and Xcode 14.2. Deleting of the project and cloning repo with install whole the project again helped me.
In my case removing arm64 value from Excluded Architectures > Debug solved the problem. (+ it should be removed from all targets including OnesignalNotificationService)
I tried building my project after doing some updates to my fbsdk, after removing errors for fbsdk related errors, this happens. I tried building to test out the updates but this happens.
This is the error https://i.imgur.com/vdJzHbz.png
I tried commonblocks to No, target.name ==" React" remove from project
Maybe someone can help me solve this.
Open Xcode > Pods > Targets Support Files > Pods-{TARGET-NAME} find
"OTHER_LDFLAGS" and remove only "-ObjC" in these two files:
Pods-{TARGET-NAME}.release.xcconfig &
Pods-{TARGET-NAME}.debug.xcconfig
Go to project main target > Build Settings > Other Linker Flags:
Make sure no "-ObjC" is left in the value
deleted the build/Build folder in ios and run-ios again. maybe It will works
.
I have an haunting issue. I am trying to build an React Native app in Xcode 8. Build/Run in Simulator works fine but as soon I start to archive I am getting the following error:
Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
That's the only error and it's after all steps have been completed with no further explanation.
Now I installed Fastlane and found out that it fails because of duplicate symbols. Removing the duplicates from "Linked Frameworks and Libraries" solves the issue and allows me to archive the app.
However now I can't build anymore for the simulator because of missing symbols.
I been looking into this for 2 days now and I can't find a solution.
Anyone has an idea why this is happening and how to solve it?
I found the solution for it!
Based on this thread https://github.com/facebook/react-native/issues/12814 if you use Pods, it also includes the base react project which will end up causing the duplicate references.
In order to fix this issue, the react reference need to be removed:
Open your [yourproject].xcworkspace
Select your Pods project
In TARGETS delete React. (clicking on the minus button - below of the targets list.)
Clean (Product > Clean) & archive/build/whatever.
Kudos to andfk for this solution!
I'm having an annoying problem with Xcode. I can't run the projects and it gives me back the same error every time:
ld: file not found: /Users/DagDigg/Library/Developer/Xcode/DerivedData/Roundy2-dtzcccrlvjvoxsapfbdzchhtuivr/Build/Intermediates/Roundy2.build/Debug-iphoneos/Roundy2.build/Objects-normal/arm64/AppDelegate.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm unable to run every project. Even if I create an empty one...
I'm using Xcode 7 beta 3 and an iPhone with iOS 9 beta 4.
Sometimes it's helpful to quit Xcode and erase the files in your DeriveData folder at
~/Library/Developer/Xcode/DerivedData
I've also fixed this issue by going to Product -> Clean in XCode. This might erase the files in the files in the Derived Data folder in the process.
Clean build folder + Rebuild the project worked for me.
Step 1: product -> Clean Build Folder
Step 2: product -> Build
Usualy this issue occur while you run your project on simulator devices ,
and simply you can remove DerivedData folder to pass this
But i suggest you to use real devices 🤞🏻
Maybe double-check the Xcode file you are running. Close the Xcode project then be sure to open the <projectname>.xcworkspace file.
If you are using cocoapods, the error can be from trying to build from the .xcodeproj file instead of the .xcworkspace file generated by the pod install.
"Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app." - guides.cocoapods.org/using/using-cocoapods
clang: error: no such file or directory: '/Users/admin/Library/Developer/Xcode/DerivedData/__TESTING__-fzbkvdbnndieeagphtjhdndiyttl/Build/Products/Debug-iphoneos/libCordova.a'
How do I get this a missing libCordova.a ?
(source: kerrydeaf.com)
UPDATE: For Simon Germain.
UPDATE: For Simon Germain. I don't see "Identity and Type". I can see "Identity". I'm using xcode 4.5
(source: kerrydeaf.com)
UPDATE: For Simon Germain. I got the Identity.
(source: kerrydeaf.com)
UPDATE: For Samuel
(source: kerrydeaf.com)
UPDATE: For Simon Germain - Architecture.
UPDATE: For james0n - armv.
(source: kerrydeaf.com)
UPDATE: For Simon Germain - Architecture.
UPDATE: For james0n - armv.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CDVURLProtocol", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
UPDATE: For james0n - Valid Architecture.
(source: kerrydeaf.com)
UPDATE: It is now solved!!! make sure all armv7 and armv7s for ios 6 on all in xcode. It worked.
For your project, set the build setting "Build Active Architecture Only" to yes.
(Maybe also set the the Architectures build setting to "Standard (armv7, armv7s)" for CordovaLib project.)
Had (as many others) the same problem, here's what I did:
Redid the Getting Started guide from Phonegap (including downloading
and extracting the source again)
Same problem with the HelloWorld app
product - clean
Changed both the 'HelloWorld' and 'CordovaLib'-project (so not the Targets) according to james0n's answer, settings:
Architectures: Standard (armv7, armv7s)
Build Active Architecture only: Yes
and then it magically worked, I think steps 3 and 4 did it however.
Only need to remove armv6 from both YourProject and CordovaLib:
The consequences of doing this? Apparently, it's still working on iPhone 3GS, but not the previous versions..
I had the same problem as you, worked fine deployed to the simulators but not to a device. Neither of the suggested answers worked for me.
Here's what did work for me:
Set deployment target to v4.3 and on the project settings for the CordovaLib project, set the Build Active Architecture Only to Yes. (Not needed on your main project).
Important, do a Product-> Clean and rebuild.
Make sure that the CordovaLib's product's target is set to "Relative to Built Product" on the right hand-side panel, first tab on theleft, under "Identity and Type".
Download the Cordova installer from here http://phonegap.com/download. Make sure it is the same version that you are currently using (ex 2.0).
Then mount the dmg found in the ios directory.
Then run the .pkg installer.
Restart Xcode.
You gotta run the update script, I know it might be a pain in the butt to do it, but that's what it takes.
Download and open the Phonegap 2.1 package from the official site. Open a terminal window, and cd to the installation directory
You'll need to first create a new project:
./create [project_folder_path] [package_name] [project_name]
Then you need to set the path to your libraries.
/update_cordova_subproject [xcodeproj file]
Now open up your project and set the deployment target to 4.3 and you should be ready to go. Hope that helps
EDIT:
This is how my configuration looks like for CordovaLib Project
Also - make sure you don't have more than one PhoneGap Xcode project open at a time - I was getting conflicts between the two. "Workspace already open in another workspace" type of loop.
After spending many hours with even more errors, here's what worked for me. Basically combining much of the above:
Start with a fresh copy of Cordova. If you've been messing with it like me, it's not fresh anymore.
Move the Cordova files out of the download directory (I tend to clean that directory now and then...)
Create a new project as described in the Phonegap docs, i.e. drag the ios/bin folder to the Terminal icon and run the create script in Terminal. No need to run the update_cordova_subproject script.
Open the project in XCode.
For your product, set the iOS Deployment Target to 4.3 (I did it 2x, both in Project and Target Build Settings).
For CordovaLib.xcodeproj, set Build for Active Architecture to Yes in the Project Build Settings.
Clean and run.
Do not include armv7s in any of the architecture lists, as it will not build for device.
Tested in simulator and on an iPad with iOS 6. Using Phonegap 2.1.0 and XCode 4.5.1.
Update: if you want to support iPhone 5, you will need armv7s. It requires the fix in https://issues.apache.org/jira/browse/CB-1360 , which will be in Cordova 2.2.0. (Haven't tried it yet, working on an iPad project.)
I fixed this by removing the armv6 and i386 architecture from Valid Architecture setting
I had this problem too. I think it was because I had previously installed an old version of phone gap that installed some stuff in xcode. I uninstalled, then reinstalled xcode. Then I ran the Uninstall Cordova.applescript that came with phone gap. This fixed the problem of the red libCordova.a
In addition to several other suggestions & post, I found that I was experiencing this problem on my AdHoc builds only. Please note that I figured this out during debugging because if I set the Edit Scheme > Archive build configuration to "release" it would work OK, but if set to AdHoc it would give me a link error, telling me that this file could not be found:
/Users/jason/Library/Developer/Xcode/DerivedData/MommyNearest-ceourmykvgxdekbkmzenuvhcfnzk/Build/Intermediates/ArchiveIntermediates/MommyNearest/BuildProductsPath/Adhoc-iphoneos/libCordova.a
This was actually a good clue to what the problem was, which was that somehow the CordovaLib subproject did not have an AdHoc configuration (it had ONLY "Debug" and "Release" configurations).
Therefore, when building for an AdHoc release (to use with Testflight) it would not create a symlink for this file correctly. Once I added an "AdHoc" configuration to the CordovaLib subproject, this started working.