我又回到了一个 React Native 项目,该项目曾经用于构建,但现在已不再构建。
我尝试过以下方法;
我遇到的问题是,当我构建项目时,我发现它找不到
DoubleConversion
库。
经过一番调查,发现这只是第一个无法找到的库,因此出现错误。在 pod 安装过程中,我可以看到它正在安装 DoubleConversion 库。
这是我运行 IOS 构建命令得到的输出。请注意,构建输出与终端或通过 xcode 的构建输出相同。
yarn ios
yarn run v1.22.19
$ react-native run-ios --simulator='iPhone 15 Pro'
info A dev server is already running for this project on port 8081.
info Found Xcode workspace "myperks.xcworkspace"
info Launching iPhone 15 Pro (iOS 17.0)
info Building (using "xcodebuild -workspace myperks.xcworkspace -configuration Debug -scheme myperks -destination id=D95E730E-FB5A-4D9A-8404-0189D398D230")
Ignoring digest-crc-0.6.4 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.4
Ignoring unf_ext-0.0.8.2 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.8.2
▸ Running script '[CP] Check Pods Manifest.lock'
▸ Running script 'Start Packager'
▸ Processing Info.plist
▸ Linking myperks
⚠️ ld: ignoring duplicate libraries: '-lc++'
⚠️ ld: search path '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk/usr/lib/swift/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk/usr/lib/swift' not found
⚠️ ld: search path '/Users/chris/Library/Developer/Xcode/DerivedData/myperks-gdtrvukhkrhlaydznulsqeffucrm/Build/Products/Debug-iphonesimulator/DoubleConversion' not found
⚠️ ld: search path '/Users/chris/Library/Developer/Xcode/DerivedData/myperks-gdtrvukhkrhlaydznulsqeffucrm/Build/Products/Debug-iphonesimulator/RCT-Folly' not found
还有更多的库无法找到,但它在示例中将其切断。
我注意到构建中寻找库的目录实际上并不存在。
/Users/chris/Library/Developer/Xcode/DerivedData/myperks-gdtrvukhkrhlaydznulsqeffucrm/Build/Products/Debug-iphonesimulator
上面存在,但是里面有另一个以应用程序命名的目录,例如myperks.app,它有一些 buits 和一个 Frameworks 目录,但没有例如 RCT-Folly。
你解决了吗?我也遇到同样的错误,找不到解决办法!