gpt4 book ai didi

ios - Lottie-react-native 不在 iOS 12 RN 0.60.4 上构建

转载 作者:行者123 更新时间:2023-12-01 19:39:09 26 4
gpt4 key购买 nike

试图将 Lottie 添加到我的 react-native 应用程序中,但它不断抛出错误。
我根据原始 github 和我在互联网上找到的帖子遵循的步骤:

(顺便说一句,我不使用 Cocoapods)

  • yarn add lottie-react-native 安装和 yarn add
    lottie-ios@3.0.3
    .
  • 手动链接它们,因为出于某种原因我的
    自动链接不起作用(我认为这是一个问题,因为我从
    0.59 到 0.60.4 或者我不知道它应该如何工作)。
  • 已添加 LottieReactNative.xcodeprojLottie.xcodeproj进入 /图书馆 在我的项目中。
  • 添加了libLottie.alibLottieReactNative.a进入 将二进制文件与库链接 .
  • 已添加 Lottie.framework进入我的目标的嵌入框架 .
  • 不知道为什么Target里面有一个Lottie_iOS(Lottie)
    依赖项,试图删除它,但它抛出一个错误说
    某些 React Native Lottie 文件上的“找不到模块 Lottie”。所以我
    加回来。
  • 添加标志 LD_VERIFY_BITCODE 并设置为“否”。取自
    一些堆栈溢出。
  • 此外,转到 XCode 的项目设置和
    更改了搭建系统Legacy Build System .

  • 到目前为止似乎没有任何效果。
    版本:
    "react": "16.8.6",
    "react-native": "^0.60.4",
    "lottie-ios": "^3.0.3",
    "lottie-react-native": "^3.1.0",

    构建失败时抛出的错误是:
    Showing Recent Messages

    Build target LottieLibraryIOS of project Lottie with configuration Debug

    <unknown>:0: error: filename "TextCompositionLayer.swift" used twice: '/Users/marian-mac/Documents/dev/MyApp/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift' and '/Users/marian-mac/Documents/dev/MyApp/node_modules/lottie-ios/lottie-swift/src/Private/LayerContainers/CompLayers/TextCompositionLayer.swift'
    <unknown>:0: note: filenames are used to distinguish private declarations with the same name
    Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

    关于发生了什么的任何想法?

    最佳答案

    问题是您的手动链接。新的自动链接过程正在使用 Cocoapods。如果可能,请使用 react-native init 创建新项目并将您的项目导入新模板或使用Upgrade Helper升级您现有的项目模板。

    关于ios - Lottie-react-native 不在 iOS 12 RN 0.60.4 上构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57641941/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com