iOS-自定义配置-“无此模块" [英] iOS - Custom Configuration - "No such module"
问题描述
在我的ios应用中,我试图区分环境,以对适当的环境(Development
,Staging
和Production
)进行Web api调用.
In my ios app, I'm trying to distinguish environments, to make web api calls to the proper environment (Development
, Staging
and Production
).
为此,我创建了一个configuration.plist
文件,其中每个环境的端点不同:
For that I have created a configuration.plist
file with the different endpoints for each environment and:
- 复制
Debug
配置并将其命名为Development Build
. - 创建了一个名为
Development
的新方案(复制了Debug
方案) 并在信息"标签(Run
部分)中选择了Development Build
配置.
- Duplicated the
Debug
Configuration and called itDevelopment Build
. - Created a new Scheme called
Development
(duplicated theDebug
scheme) and in the Info tab (Run
section) chose theDevelopment Build
configuration.
当我在调试"模式下运行时,一切正常运行.
When I run in Debug mode, everything runs normally.
我正在使用可可豆荚.
如果选择Development
方案,则会得到No such module 'JazzHands'
If I select Development
scheme, I get a No such module 'JazzHands'
如果我编辑Development
方案以使用Debug
构建,则可以正常工作.
If I edit the Development
scheme to use the Debug
build, it works fine.
所以我必须丢失一些东西才能使它不起作用.
So I must be missing some thing for this not to work.
推荐答案
对于遇到此问题的人员,请尝试pod install
,这将生成一些带有您的配置名称的.xcconfig文件.清理您的构建文件夹,然后重新构建.
For those running into this question, try pod install
this will generate some .xcconfig files with your configuration name. Clean your build folder and build again.
这对我来说与Cocoapods 1.0兼容
This worked for me with Cocoapods 1.0
这篇关于iOS-自定义配置-“无此模块"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!