Reputation: 4600
Help, this is driving me crazy. I was running out of space on my boot disk, so I moved most of my documents over to a second drive, including all my Xcode projects. Now, I need to fix an old app and make it updated for new iOS, and it won't build. The linker is giving this error message:
No such file or directory: 'JavaScript Core'
When I click on it, I get the details below. I have tried looking in the project build settings Linking section, the Other Linker Flags. It does include JavaScript, but isn't that needed if the app displays HTML pages in a browser view? I don't think I want to remove it. I also tried manually adding JavaScriptCore library in the Build Phases linked libraries, that did not remove the error. In between each and every change, I do a Clean then Build.
FYI, I also at one point moved my old hard drive to become the second, and installed a new boot drive. The old one is called "Macintosh HD" while the new one is called "Macintosh SSD" - so it's possible that some paths are still referring to the old location. I noticed that the paths are prefixed by $(PODS_ROOT), which evaluates to /Volumes/Macintosh HD/Documents/XCodeProjects....etc This is the old hard drive where the projects are currently. However, when they were first created, that used to be the boot (and only) drive.
Details of the error:
Ld /Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Products/Debug-iphonesimulator/itsettings.app/itsettings normal x86_64 cd "/Volumes/Macintosh HD/Documents/XCodeProjects/iPhone/ITSettings" export IPHONEOS_DEPLOYMENT_TARGET=9.0 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L/Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Products/Debug-iphonesimulator -L/Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac -L/Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Products/Debug-iphonesimulator/SBJson5 -L/Volumes/Macintosh\ HD/Documents/XCodeProjects/iPhone/ITSettings/ITSettings -F/Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Products/Debug-iphonesimulator -F/Volumes/Macintosh\ HD/Documents/XCodeProjects/iPhone/ITSettings/Pods/FirebaseAnalytics/Frameworks/frameworks -F/Volumes/Macintosh\ HD/Documents/XCodeProjects/iPhone/ITSettings/Pods/FirebaseCore/Frameworks/frameworks -F/Volumes/Macintosh\ HD/Documents/XCodeProjects/iPhone/ITSettings/Pods/FirebaseInstanceID/Frameworks/frameworks -F/Volumes/Macintosh\ HD/Documents/XCodeProjects/iPhone/ITSettings/Pods/Google-Mobile-Ads-SDK/Frameworks/frameworks -F/Volumes/Macintosh\ HD/Documents/XCodeProjects/iPhone/ITSettings/Pods/GoogleInterchangeUtilities/Frameworks/frameworks -F/Volumes/Macintosh\ HD/Documents/XCodeProjects/iPhone/ITSettings/Pods/GoogleSymbolUtilities/Frameworks/frameworks -filelist /Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Intermediates/itsettings.build/Debug-iphonesimulator/ITSettings.build/Objects-normal/x86_64/itsettings.LinkFileList -mios-simulator-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Intermediates/itsettings.build/Debug-iphonesimulator/ITSettings.build/Objects-normal/x86_64/itsettings_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lGoogleToolboxForMac -lSBJson5 -lc++ -lsqlite3 -lz -framework AVFoundation -framework AddressBook -framework AudioToolbox -framework CoreGraphics -framework CoreMedia -framework CoreMotion -framework CoreTelephony -framework CoreVideo -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseInstanceID -framework GLKit -framework GoogleInterchangeUtilities -framework GoogleMobileAds -framework GoogleSymbolUtilities -framework MediaPlayer -framework MessageUI -framework MobileCoreServices -framework OpenGLES -framework StoreKit -framework SystemConfiguration -weak_framework AdSupport -weak_framework JavaScriptCore -weak_framework SafariServices -weak_framework WebKit -ObjC -lGoogleToolboxForMac -lc++ -lz -framework AVFoundation -framework AddressBook -framework AudioToolbox -framework CoreGraphics -framework CoreMedia -framework CoreMotion -framework CoreTelephony -framework CoreVideo -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseInstanceID -framework GLKit -framework GoogleInterchangeUtilities -framework GoogleMobileAds -framework GoogleSymbolUtilities -framework MediaPlayer -framework MessageUI -framework MobileCoreServices -framework OpenGLES -framework StoreKit -framework SystemConfiguration -weak_framework -weak_framework JavaScriptCore -weak_framework SafariServices -weak_framework WebKit -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Intermediates/itsettings.build/Debug-iphonesimulator/ITSettings.build/itsettings.app.xcent -framework JavaScriptCore -lz.1 -framework SystemConfiguration -framework StoreKit -framework MessageUI -framework EventKitUI -framework EventKit -framework CoreGraphics -framework AVFoundation -framework AudioToolbox -framework AdSupport -framework GoogleMobileAds -framework UIKit -framework Foundation -lPods-ITSettings -Xlinker -dependency_info -Xlinker /Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Intermediates/itsettings.build/Debug-iphonesimulator/ITSettings.build/Objects-normal/x86_64/itsettings_dependency_info.dat -o /Users/jimerman/Library/Developer/Xcode/DerivedData/itsettings-emxzrujgnlqhsodyyuwgfolwckjc/Build/Products/Debug-iphonesimulator/itsettings.app/itsettings
clang: error: no such file or directory: 'JavaScriptCore'
Upvotes: 1
Views: 755
Reputation: 1435
I had the same, or similar at least, problem and the fix was to go over my linker flags in the build settings very carefully. I found that in one of my build configurations I had an incomplete linker flag value that expected something to follow it. As it turns out, when it outputs the command the next word was the framework, and so it thought it could not find a folder with that name (the flag that was incomplete should have been followed by a folder name). In short, review all your linker flags in detail and make sure they are complete.
Upvotes: 0