ld: library not found for -lDoubleConversion React Native 0.59

前端 未结 4 1499
太阳男子
太阳男子 2021-01-18 16:19

I have this error

❌  ld: library not found for -lDoubleConversion

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


erro         


        
4条回答
  •  耶瑟儿~
    2021-01-18 17:00

    First of all, make sure that Libraries -> React.xcodeproj -> ThirdParty -> double-conversion exists and a static library is being produced from it, like this:

    Then, if are you're using cocoapods, make sure to add DoubleConversion to your Podfile:

    target 'MyApp' do
      pod 'React', :path => "../node_modules/react-native", :subspecs => [
        'Core',
        'CxxBridge',
        'DevSupport',
        # the following ones are the ones taken from "Libraries" in Xcode:
        'RCTAnimation',
        'RCTActionSheet',
        'RCTBlob',
        'RCTGeolocation',
        'RCTImage',
        'RCTLinkingIOS',
        'RCTNetwork',
        'RCTSettings',
        'RCTText',
        'RCTVibration',
        'RCTWebSocket'
      ]
      pod 'yoga', :path => "../node_modules/react-native/ReactCommon/yoga"
    
      # Here it goes
      pod 'DoubleConversion', :podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
    
      pod 'glog', :podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec"
      pod 'Folly', :podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec"
    end
    

    And finally, if none of this worked so far, there's a script you can manually run in order to resolve React's third-party dependencies.

    Just go to node_modules/react-native and type:

    $ ./scripts/ios-install-third-party.sh
    

    Important: Always run it inside node_modules/react-native. Because, as far as I know, the script uses relative paths in order to store third-party's source code and react native will always look for it at node_modules/react-native/third-party. So just make sure to run it in the right place.

    Note: This script is, probably, already running as a build phase on your project.

提交回复
热议问题