我创建了一个 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
在搜索解决方案时,我发现此错误是由s.source_files = "**/*.{h,m,swift}"
. 所以,我评论了这一行并pod install
再次运行。错误消失了,但没有将依赖项添加到 Project 目标中。谁能给我提供用于React Native Library中本地.xcframework的Podspec文件。提前致谢!