Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 277
Jayprakash Dubey Avatar asked Aug 02 '16 10:08

Jayprakash Dubey


6 Answers

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

like image 62
lingyfh Avatar answered Nov 18 '22 14:11

lingyfh


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

like image 33
Basheer Avatar answered Nov 18 '22 13:11

Basheer


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.

like image 2
Harrison Xi Avatar answered Nov 18 '22 14:11

Harrison Xi


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.

like image 1
Andrew Avatar answered Nov 18 '22 15:11

Andrew


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.

like image 1
mackworth Avatar answered Nov 18 '22 14:11

mackworth


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.

like image 1
Ravi Panchal Avatar answered Nov 18 '22 14:11

Ravi Panchal