iOS - Custom Configuration - “No such module”

被刻印的时光 ゝ 提交于 2020-01-21 01:38:05

问题


In my ios app, I'm trying to distinguish environments, to make web api calls to the proper environment (Development, Staging and Production).

For that I have created a configuration.plist file with the different endpoints for each environment and:

  • Duplicated the Debug Configuration and called it Development Build.
  • Created a new Scheme called Development (duplicated the Debug scheme) and in the Info tab (Run section) chose the Development Build configuration.

When I run in Debug mode, everything runs normally.

I'm using cocoa pods.

If I select Development scheme, I get a No such module 'JazzHands'

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.


回答1:


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.

This worked for me with Cocoapods 1.0




回答2:


Solution:

Create the same custom build configuration in JazzHands

Root cause:

  • Compilation error No such module is thrown because it can't locate the JazzHands for your custom build configuration

Background:

  • Every time you compile a folder is created in DerivedData.
  • This folder corresponds to your device / simulator and your app.
  • Inside this folder there would be a Build folder which would contain a folder corresponding to each build configuration for your project.
  • In your case Development folder would not contain the framework JazzHands binary
  • However Debug folder would contain the framework JazzHands binary

Example:

Given below is an example:

~/Library/Developer/Xcode/DerivedData/SomeApp-skjahjkdhsakjhdaskjdhaskjlhs/Build/Development-iphonesimulator

  • SomeApp - Name of the app
  • Development - Custom Build configuration


来源:https://stackoverflow.com/questions/33520503/ios-custom-configuration-no-such-module

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!