firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Apple Mach-O Linker (ld) Error Group

Open TofPlay opened this issue 9 years ago • 24 comments

  • Xcode version: Xcode 9.0 (9A235) (GM version)
  • Firebase SDK version: Firebase 4.1.1
  • Library version: _____
  • Firebase Product: core, crash

Step 3: Describe the problem

At build generate error Apple Mach-O Linker (ld) Error Group

ld: warning: directory not found for option '-F/Users/me/Library/Developer/Xcode/DerivedData/My App-cbbpbhsjrtvjwkakgwmzqckliizs/Build/Products/Debug-iphoneos/GoogleToolboxForMac'
ld: warning: directory not found for option '-F/Users/me/Library/Developer/Xcode/DerivedData/My App-cbbpbhsjrtvjwkakgwmzqckliizs/Build/Products/Debug-iphoneos/Protobuf'
ld: warning: directory not found for option '-F/Users/me/Library/Developer/Xcode/DerivedData/My App-cbbpbhsjrtvjwkakgwmzqckliizs/Build/Products/Debug-iphoneos/nanopb'
ld: framework not found GoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to reproduce:

  1. Create a project and with CocoaPods define a Podfile:
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'
use_frameworks!

target 'My App' do
  pod 'Firebase/Analytics'
  pod 'Firebase/Crash'
end
  1. Install pods
$ pod --version
1.3.1
$ pod install
Analyzing dependencies
Downloading dependencies
Installing Firebase (4.1.1)
Installing FirebaseAnalytics (4.0.3)
Installing FirebaseCore (4.0.6)
Installing FirebaseCrash (2.0.1)
Installing FirebaseInstanceID (2.0.2)
Installing GoogleToolboxForMac (2.1.1)
Installing Protobuf (3.4.0)
Installing nanopb (0.3.8)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `My App.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 9 total pods installed.
  1. Build the app

TofPlay avatar Sep 13 '17 08:09 TofPlay

Most likely you need to generate the Xcode workspace instead of the Xcode project. More details at https://stackoverflow.com/questions/40358719/framework-not-found-googletoolboxformac

paulb777 avatar Sep 13 '17 13:09 paulb777

I used workspace already not the xcode project I also done pod deintegrate, rm -rf Pods/ Podfile.lock *.xcworkspace followed by pod install to regenerate the workspace. That doesn't changed anything.

TofPlay avatar Sep 13 '17 13:09 TofPlay

Try removing Xcode's DerivedData. One way is rm -rf ~/Library/Developer/Xcode/DerivedData

paulb777 avatar Sep 13 '17 14:09 paulb777

Already done several times

TofPlay avatar Sep 13 '17 14:09 TofPlay

Are you able to build the Firebase Quickstarts? For example, https://github.com/firebase/quickstart-ios/tree/master/analytics

paulb777 avatar Sep 13 '17 14:09 paulb777

Yes I can build analytics

TofPlay avatar Sep 14 '17 08:09 TofPlay

From what I can see CocoaPods does not build Firebase components on my project. On DerivedData/<My folder project build>/Build/Products/Debug-iphoneos I don't have any Firebase framework. The project Pods is not build automatically.

TofPlay avatar Sep 14 '17 09:09 TofPlay

Found it! Go to <Your app> > Edit Scheme > Build the option Find Implicit Dependencies must be checked

image

TofPlay avatar Sep 14 '17 13:09 TofPlay

@TofPlay Good find! Thanks for tracking it down and sharing!

Do you know how Find Implicit Dependencies got unchecked? It seems to always checked by default on project creation.

paulb777 avatar Sep 14 '17 13:09 paulb777

Do you know how Find Implicit Dependencies got unchecked?

No I don't know. I'm sure I doesn't unchecked by myself!

TofPlay avatar Sep 14 '17 13:09 TofPlay

I have the same errors, Xcode version is 8.3.3 and Pod version: 1.3.1 with @TofPlay's same pod installations, running on Mac OS X 10.12.6.

*Terminal displayed this in addition to @TofPlay error results:

        Ld build/emulator/PROJECT_NAME.app/PROJECT_NAME normal x86_64
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -
xcconfig,/Users/user/Desktop/PROJECT_NAME/platforms/ios/cordova/build-debug.xcconfig,-
workspace,PROJECT_NAME.xcworkspace,-scheme,PROJECT_NAME,-configuration,Debug,-
sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone
SE,build,CONFIGURATION_BUILD_DIR=/Users/user/Desktop/PROJECT_NAME/platforms/ios/build/e
mulator,SHARED_PRECOMPS_DIR=/Users/user/Desktop/PROJECT_NAME/platforms/ios/build/sharedpch

omarhuss avatar Sep 21 '17 17:09 omarhuss

@paulb777 do you have plan to provide a Carthage version of your component? On our new projects CocoaPods is no longer accepted. And gradually the components that do not support Carthage are removed from the old projects. If Firebase does not offer Carthage support we will migrate to another solution.

TofPlay avatar Sep 24 '17 05:09 TofPlay

@TofPlay see #9 (cc @salqadri)

morganchen12 avatar Sep 25 '17 17:09 morganchen12

@morganchen12 I know this ticket. I even tried to help you by providing you a link on a tutorial for cross platform framework and Carthage support.

The removal of CocoaPods is in progress... tic tac tic tac ⏳

TofPlay avatar Sep 26 '17 05:09 TofPlay

Ah, whoops :)

We don't have plans to distribute dylibs, which is the main driver behind us not supporting Carthage. However, it may be worth while trying to distribute a static framework module through Carthage since we'd be distributing a binary anyway. Carthage iirc should just download this module and place it in a folder, leaving the integration to the developer--so it shouldn't cause any fundamental incompatibility issues unless someone tries to wrap our static module in a dylib and redistribute it.

Would this be suitable for your needs?

morganchen12 avatar Sep 26 '17 17:09 morganchen12

Would this be suitable for your needs?

No. We will not, just for Firebase, have a special process. If you do not support Carthage very soon Firebase will be removed from our projects.

TofPlay avatar Sep 30 '17 19:09 TofPlay

TofPlay same error for me , i have " Find Implicit " checked!! please help

papago-development avatar Oct 05 '17 17:10 papago-development

now i have libMobileGestalt MobileGestaltSupport.m:153: pid 411 (MyApp) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled

papago-development avatar Oct 05 '17 17:10 papago-development

Here's what worked for me: remove the affected pod (for me it was firebase) from your podfile run pod install put the removed pods back into the podfile again run pod install. Clean and rebuild your project!

grubephi avatar Dec 13 '17 18:12 grubephi

@grubephi Just tried that. Still no luck in a permanent solution when just creating a super simple Firebase project.

For me, what works is simply cleaning the project (CMD + SHIFT + K)

Very annoying, but I'm sure we'll find a better solution eventually.

technoplato avatar Dec 31 '17 19:12 technoplato