react-native-fabric icon indicating copy to clipboard operation
react-native-fabric copied to clipboard

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Open wpconsulate opened this issue 8 years ago • 6 comments

Im using an Expo detached ExpoKit Project where I'm trying to install ReactNativeFabric. I'm able to Install Fabric SDK and Crashlytics SDK via pod file and I setup the iOS app on fabric as well installed locally the fabric app ( mac as well ) at this point build works fine and no error.

After this I followed these Steps

  • Open your project in Xcode
  • Run open node_modules/react-native-fabric/ios
  • Drag SMXCrashlytics.xcodeproj into your Libraries group
  • Select your main project in the navigator to bring up settings
  • Under Build Phases expand the Link Binary With Libraries header
  • Scroll down and click the + to add a library
  • Find and add libSMXCrashlytics.a under the Workspace group
  • ⌘+B

After these steps I'm getting Error clang: error: linker command failed with exit code 1

and build is failing, because of this Screeenshot : http://prntscr.com/k8geod

Some of the logs

ld: warning: object file (/Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/UrbanAirship-iOS-SDK/libUrbanAirship-iOS-SDK.a(NSOperationQueue+UAAdditions.o)) was built for newer iOS version (9.0) than being linked (8.0) ld: warning: object file (/Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/UrbanAirship-iOS-SDK/libUrbanAirship-iOS-SDK.a(NSString+UALocalizationAdditions.o)) was built for newer iOS version (9.0) than being linked (8.0) ld: warning: object file (/Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/UrbanAirship-iOS-SDK/libUrbanAirship-iOS-SDK.a(NSString+UAURLEncoding.o)) was built for newer iOS version (9.0) than being linked (8.0) ld: warning: object file (/Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/UrbanAirship-iOS-SDK/libUrbanAirship-iOS-SDK.a(NSURLResponse+UAAdditions.o)) was built for newer iOS version (9.0) than being linked (8.0) ld: warning: object file (/Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/UrbanAirship-iOS-SDK/libUrbanAirship-iOS-SDK.a(UA_Base64.o)) was built for newer iOS version (9.0) than being linked (8.0) ld: warning: object file (/Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/UrbanAirship-iOS-SDK/libUrbanAirship-iOS-SDK.a(UAAction+Operators.o)) was built for newer iOS version (9.0) than being linked (8.0) ld: warning: object file (/Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/UrbanAirship-iOS-SDK/libUrbanAirship-iOS-SDK.a(UAPreferenceDataStore+TagGroupsMutation.o)) was built for newer iOS version (9.0) than being linked (8.0) ld: warning: object file (/Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/UrbanAirship-iOS-SDK/libUrbanAirship-iOS-SDK.a(UIWebView+UAAdditions.o)) was built for newer iOS version (9.0) than being linked (8.0) ld: warning: object file (/Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libPods-petmeds.a(Pods-petmeds-dummy.o)) was built for newer iOS version (9.0) than being linked (8.0) duplicate symbol _KWObjCTypeIsFloatingPoint in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXCrashlytics.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXCrashlytics.o) duplicate symbol _OBJC_CLASS_$_SMXCrashlytics in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXCrashlytics.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXCrashlytics.o) duplicate symbol _OBJC_METACLASS_$_SMXCrashlytics in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXCrashlytics.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXCrashlytics.o) duplicate symbol _DefaultDomain in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXCrashlytics.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXCrashlytics.o) duplicate symbol _KWObjCTypeIsIntegral in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXCrashlytics.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXCrashlytics.o) duplicate symbol _KWObjCTypeIsUnsignedIntegral in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXCrashlytics.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXCrashlytics.o) duplicate symbol _KWObjCTypeIsSignedIntegral in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXCrashlytics.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXCrashlytics.o) duplicate symbol _OBJC_IVAR_$_SMXCrashlytics._bridge in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXCrashlytics.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXCrashlytics.o) duplicate symbol _DefaultCode in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXCrashlytics.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXCrashlytics.o) duplicate symbol _OBJC_CLASS_$_SMXAnswers in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXAnswers.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXAnswers.o) duplicate symbol _OBJC_METACLASS_$_SMXAnswers in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXAnswers.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXAnswers.o) duplicate symbol _OBJC_IVAR_$_SMXAnswers._bridge in: /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/ReactNativeFabric/libReactNativeFabric.a(SMXAnswers.o) /Users/apple/Library/Developer/Xcode/DerivedData/petmeds-hhauefdqgavvfoaqresmzvbjjivq/Build/Products/Debug-iphoneos/libSMXCrashlytics.a(SMXAnswers.o) ld: 12 duplicate symbols for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Showing first 200 warnings only

Any help at this point will be useful.

thanks

wpconsulate avatar Jul 19 '18 14:07 wpconsulate

I figured it out.

1. Add Fabric / Crashlytics to your project First, set up Fabric / Crashlytics in your app as instructed on Fabric.io. This includes downloading the fabric app and walking through the setup steps (downloading the SDK, adding it to your project and making some changes to your project).

  • This part in the documentation is not right?? because we don't need to install fabric SDK's if we are going to do the following

Manually iOS With CocoaPods support add the following line to Podfile pod 'ReactNativeFabric', :path => '../node_modules/react-native-fabric'

So I just removed the fabric SDK I installed and then just installed this pod and it built fine. I'll try testing and update this post accordingly. maybe I missed something after removing default fabric SDk??

wpconsulate avatar Jul 19 '18 21:07 wpconsulate

@wpconsulate i tried what you said. Its still giving me the same error.

HannanShaikYara avatar Sep 25 '18 04:09 HannanShaikYara

apparently couldn't use fabric on a detached expokit project it kepts crashing when I add [Fabric with:@[[Crashlytics class]]]; to AppDelegate.m

logicallyDimp avatar Dec 03 '18 10:12 logicallyDimp

Guys Help!!! The same issue as @logicallyDimp has/had...

@logicallyDimp Did you solve that issue? Where the problem was? What can I do?

dkfl1995 avatar Jan 24 '19 15:01 dkfl1995

So for everyone, if you are getting this kind of error then the issue could be you have installed the react-native-fabric plugin twice in your project. In simple words. You have installed it via cocoapods and manually as well. So do one thing. If you installed it manually using the method specified here https://github.com/corymsmith/react-native-fabric#manually then just remove the podfile line pod 'ReactNativeFabric', :path => '../node_modules/react-native-fabric'

and and redo npm install or yarn and under your ios folder run pod install this should fix the issue.

wpconsulate avatar Feb 04 '19 06:02 wpconsulate

For my case it was that my XCode needed to update it's dependencies. Try Build -> Clean and build again in XCode watching for prompts to install and say yes..

FrankGoortani avatar Mar 30 '19 16:03 FrankGoortani