ios - react native 错误 ld : library not found for -lBVLinearGradient

标签 ios xcode react-native

在我的新 react-native 项目中安装了“react-native-lienar-gradient”库。
在 Podfile 中添加了 pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
在 ios 目录中执行 pod install
Xcode 构建给出了以下错误:
ld:警告:找不到选项“-L-L/Users/pavneet/Library/Developer/Xcode/DerivedData/Krowym-fttolxdorzfwjbcgjwmxijsnufkv/Build/Products/Debug-iphonesimulator/BVLinearGradient”的目录
ld:未找到 -lBVLinearGradient 的库
clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Error in Xcode
尝试删除 Podfile.lock,清理 xcode 构建,通过 react-native 链接命令手动链接库,删除派生数据文件夹
还尝试在 Build Phases -> Link Binary With Libraries 上添加 libBVLinearGradient.a
环境
react 原生:0.63.2
react 原生线性梯度:2.5.6

最佳答案

你可以试试这个。
先解体再安装pods

  • sudo gem update –system
  • sudo gem install -n /usr/local/bin cocoapods
  • pod setup
  • cd ios
  • pod deintegrate
  • pod install

  • 然后返回并通过 deleting ios build and watchman 运行应用程序和 clearing metro server and simulator cache还有 deleting and reinstalling node modules
  • cd ..
  • watchman watch-del-all && rm -rf $TMPDIR/react-*  && rm -fr $TMPDIR/metro-cache* && rm -fr $TMPDIR/haste-map-metro*  &&  rm -rf ios/build && xcrun simctl erase all && rm -rf node_modules/ && npm cache verify && npm install && react-native run-ios -- --reset-cache
    
  • 关于ios - react native 错误 ld : library not found for -lBVLinearGradient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64098782/

    相关文章:

    ios - 是否可以显示UIImage的片段?

    ios - Fabric 如何获取 iOS 设备的 iOS UDID?

    iOS:AVPlayer play 有时无法播放

    ios - 提交 EditingStyle 删除按钮不会显示

    ios - 适用于 iOS 的 Cordova 错误 ITMS-90022 : "Missing required icon file"

    javascript - 从 apisauce 中的 SecureStore 加载 header

    ios - 设置调试或发布 | react native - iOS

    ios - 验证失败后刷新(重新加载)NSManagedObject

    ios - 在 Xcode 5.1.1 中打开 Storyboard后屏幕变黑

    android - 评估设置 'android' 时出现问题。 gradle.groovy 不存在