尝试导入 web3swift 时出现编译错误
Posted
技术标签:
【中文标题】尝试导入 web3swift 时出现编译错误【英文标题】:Compile error when trying to import web3swift 【发布时间】:2018-09-26 07:02:24 【问题描述】:我正在尝试将web3swift
导入我的Swift
文件之一,但出现编译器错误
没有这样的模块'web3swift'"。
导入语句如下所示:
import Geth
import web3swift
在我的 pod 文件中,我有:
pod 'web3swift', :git => 'https://github.com/MercuryProtocol/web3.swift.git', :branch => 'master'
我也尝试了以下没有奏效的修复:
转到Build Settings
搜索Framework Search Paths
(区分大小写)
双击<Multiple values>
点击+
添加 $(SRCROOT) 并将其设置为递归
【问题讨论】:
你打开的是YourProject.xcworkspace
文件还是YourProject.xcodeproj
?
我正在打开 .xcworkspace 文件
在项目导航器中选择 Pods
项目。在右侧窗格中,选择 web3swift
目标。选择构建设置。搜索产品模块名称。
然后...?它选择了 web3sweift,但我是否应该更改设置,因为似乎没有设置?
【参考方案1】:
根据您的问题 - 可能您正在使用另一个 repo。请查看实际版本0.7.0
web3swift 可通过CocoaPods 获得。安装 它,只需将以下行添加到您的 Podfile 中:
pod 'web3swift', git: 'https://github.com/matterinc/web3swift'
从命令行运行pod install
之后它应该可以正常工作。 如果您仍然有问题,请随时打开问题: https://github.com/matterinc/web3swift/issues
【讨论】:
以上是关于尝试导入 web3swift 时出现编译错误的主要内容,如果未能解决你的问题,请参考以下文章
在编译c++代码时出现如下错误: 望速度解答,很急。。谢谢!