Jayprakash Dubey
Jayprakash Dubey

Reputation: 36447

iOS : Could not build module <framework-name>

I've got Library from another team. I'm trying to use library in our project and while do so getting an error Could not build module 'Common Library' (name of framework)

Screenshot 1

Below are solutions that I worked on but didn't helped :

1. Delete Derived data content. Clean and Build.

2. Framework is added in 'Link binary with libraries' of Build phases.

3. While adding framework checkmarked : Target and Copy content to folder.

Even I tried this stackoverflow-link but didn't got any break-through!

screenshot 2

screenshot 3

The only thing that worked was deleting Objective-C bridging header path in Swift compiler - code generation section of build settings in Project.

However, thereafter I'm not able to get Common interface to create instance (i.e. Common dosen't appears in drop-down list)

Below is framework structure.

Screenshot 6

Any other fix?

Upvotes: 29

Views: 33785

Answers (6)

Ravi Panchal
Ravi Panchal

Reputation: 1355

As this question do not have answer yet, so adding my answer here it may help in future for some another developer.

I know due to privacy you can not disclose the details.

I have used same library and faced same issue so just did did this two things it is working fine.

  1. In General -> Frameworks,Libraries -> CommonLibrary.framework just select that and choose -> Embed Without Signing.

  2. Build Settings -> Search for "workspace" -> Validate workspace -> set it NO

That's it you are done.

Upvotes: 1

mackworth
mackworth

Reputation: 5953

I also had this problem, due to a typo in my GCC_PREPROCESSOR_DEFINITIONS, which therefore invalidated all of my code.

First helpful warning was multiple "Macro Name must be an identifier" followed by multiple "Could not build module" messages.

Upvotes: 1

lingyfh
lingyfh

Reputation: 1383

you can try delete DerivedData dir.

where is DerivedData?(xcode 8)

go to File > workspace Settings, you'll see DerivedData path.

DerivedData path in xcode 8

enter image description hereenter image description here

Upvotes: 10

Andrew
Andrew

Reputation: 1106

I also had this problem: 1. My 'GoodLuck' framework had two headers: GoodLuck.h and GLAdder.h 2. Project which import this framework couldn't compile

Solution: Import GLAdder.h in GoodLuck.h, rebuild the framework. It works.

Upvotes: 1

Harrison Xi
Harrison Xi

Reputation: 796

I think you does not need to compile CommonLibrary.framework again. So you can try to remove it from Embedded Binaries list. And make sure the path of CommonLibrary.framework is in your Framework Search Paths.

Upvotes: 3

Basheer
Basheer

Reputation: 1207

Check whether the framework you are integrating is supporting your project architecture.

To see the framework supported architecture, use Terminal and navigate to Framework folder.

use, "lipo -info myFramework.framework/MyFramework"

And, if you want to use the framework files in your project, check whether the files are available in Framework/Headers Folder.

Getting this error :

Screenshot

Try, "file myFramework.framework/MyFramework" in Terminal

Upvotes: 2

Related Questions