Ank*_*uri 5 ios cocoapods podspec react-native-ios xcframework
我创建了一个 React Native 库,它是在 React Native 项目中使用本机 iOS 框架的包装器。早些时候我使用过.framework,它运行良好。现在我在使用这个库时遇到问题.xcframework而不是.framework。
我将此库添加为项目的依赖项,然后在运行时pod install出现以下错误:
[!] [Xcodeproj] 生成重复的 UUID:
当我打开项目并尝试构建它时,它在设备上成功构建,但在模拟器上失败。
以下是我在库项目中使用的 Podspec 文件:
Pod::Spec.new do |s|
s.name = "react-native-myLibrary"
s.version = "1.0.0"
s.summary = "react-native-myLibrary"
s.description = <<-DESC
react-native-myLibrary
DESC
s.homepage = "https://github.com/geektimecoil/react-native-onesignal"
s.license = "MIT"
s.author = { "author" => "author@domain.cn" }
s.platform = :ios, "10.0"
s.source = { :http => 'file:' + __dir__ + '/' }
s.source_files = "**/*.{h,m,swift}"
s.requires_arc = true
s.vendored_frameworks = 'MyLibrary.xcframework'
s.dependency "React"
end
Run Code Online (Sandbox Code Playgroud)
在搜索解决方案时,我发现此错误是由s.source_files = "**/*.{h,m,swift}". 所以,我评论了这一行并pod install再次运行。错误消失了,但没有将依赖项添加到项目目标中。任何人都可以向我提供用于 React Native 库中的本地.xcframework的Podspec文件。提前致谢!
我能够使用以下方法解决此问题:
s.source_files = "ios/*.{h,m,swift}"
s.vendored_frameworks = 'ios/Frameworks/MyLibrary.xcframework'
Run Code Online (Sandbox Code Playgroud)
还可以通过将框架搜索路径从构建设置更新为$(inherited)。
| 归档时间: |
|
| 查看次数: |
7133 次 |
| 最近记录: |