简体   繁体   English

React Native:iOS-未找到-lbolts的库

[英]React native: ios - Library not found for -lbolts

  • React native 0.57 反应本机0.57
  • CocoaPods 1.5.3 CocoaPods 1.5.3
  • Xcode 10.1 Xcode 10.1

I've build in debug mode It's fine but archive got errors message 我已在调试模式下构建,可以,但是存档收到错误消息

Figure 1: Errors 图1:错误

图1:错误

I've open .xcworkspace instead of .xcodeproj. 我已经打开.xcworkspace而不是.xcodeproj。 And remove Pods, Podfile.lock re-install pods but still not work. 并删除Pod,重新安装Podfile.lock Pod,但仍然无法正常工作。

I've try to link libBolts in Link Binary With Libraries but Xcode still asking for other lib up to IPods-PorjectName. 我尝试将“链接二进制文件与库”中的libBolts链接起来,但Xcode仍要求其他库达到IPods-PorjectName。 But It's already in Link Binary With Libraries. 但是它已经在与库链接二进制文件中。

Podfile 播客文件

# Uncomment the next line to define a global platform for your project
platform :ios, '12.1'

target 'Project' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  rn_path = '../node_modules/react-native' # This path is likely to be `../node_modules/react-native` in your own project.

  # See http://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies
  pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
  pod 'React', path: rn_path, subspecs: [
    'Core',
    'DevSupport',
    'ART',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
  ]

  pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'

  pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'

  pod 'react-native-fetch-blob', :path => '../node_modules/react-native-fetch-blob'

  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

end

Package.json Package.json

{
  "name": "Project",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "@types/styled-components": "^4.1.6",
    "axios": "^0.18.0",
    "moment": "^2.24.0",
    "native-base": "^2.10.0",
    "prop-types": "^15.6.2",
    "react": "16.6.3",
    "react-addons-update": "^15.6.2",
    "react-native": "0.57.8",
    "react-native-autogrow-textinput": "^5.2.0",
    "react-native-cached-image": "^1.4.3",
    "react-native-fbsdk": "^0.8.0",
    "react-native-fetch-blob": "^0.10.8",
    "react-native-firebase": "^5.2.2",
    "react-native-gifted-chat": "^0.7.2",
    "react-native-highcharts": "^1.0.2",
    "react-native-image-picker": "^0.28.0",
    "react-native-image-zoom-viewer": "^2.2.25",
    "react-native-linear-gradient": "^2.5.3",
    "react-native-popup-menu": "^0.15.0",
    "react-native-read-more-text": "^1.1.0",
    "react-native-render-html": "^4.1.1",
    "react-native-router-flux": "^4.0.6",
    "react-native-size-matters": "^0.1.6",
    "react-native-swiper": "^1.5.14",
    "react-native-view-more-text": "^2.0.1",
    "react-redux": "^6.0.0",
    "redux": "^4.0.1",
    "redux-thunk": "^2.3.0",
    "socket.io-client": "^2.2.0",
    "styled-components": "^4.1.3"
  },
  "devDependencies": {
    "@types/jest": "^23.3.13",
    "@types/react": "^16.7.20",
    "@types/react-native": "^0.57.29",
    "@types/react-test-renderer": "^16.0.3",
    "babel-jest": "23.6.0",
    "eslint-config-rallycoding": "^3.2.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-native-typescript-transformer": "^1.2.11",
    "react-test-renderer": "16.6.3",
    "typescript": "^3.2.4"
  },
  "jest": {
    "preset": "react-native",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js"
    ],
    "transform": {
      "^.+\\.(js)$": "<rootDir>/node_modules/babel-jest",
      "\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
    },
    "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
    "testPathIgnorePatterns": [
      "\\.snap$",
      "<rootDir>/node_modules/"
    ],
    "cacheDirectory": ".jest/cache"
  },
  "rnpm": {
    "assets": [
      "./src/assets/fonts"
    ]
  }
}

将二进制文件与库链接

在您的.xcworkspace => Build Phases ==> Link Binary with Libraries中:添加libPods-Project.a

Finally I solved It by change Deployment target version to 12.1 because version are difference between Podfile and Deployment target. 最后,我通过将部署目标版本更改为12.1解决了它,因为版本是Podfile和部署目标之间的区别。 Then everything is fine!. 然后,一切都很好!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM