corymsmith / react-native-fabric

A React Native library for Fabric, Crashlytics and Answers
MIT License
1.31k stars 236 forks source link

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

Closed wpconsulate closed 5 years ago

wpconsulate commented 6 years ago

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

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 commented 6 years ago

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).

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??

HannanShaikYara commented 6 years ago

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

logicallyDimp commented 5 years ago

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

dkfl1995 commented 5 years ago

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

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

wpconsulate commented 5 years ago

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.

FrankGoortani commented 5 years ago

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..