28

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?

Community
  • 1
  • 1
Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
  • check this it may help you : http://stackoverflow.com/questions/29620786/import-causes-parse-issue-could-not-build-module – Pandey_Laxman Aug 02 '16 at 10:39
  • @Pandey_Laxman : Didn't helped. :-( – Jayprakash Dubey Aug 03 '16 at 10:30
  • Can you try to delete import line and rewrite it again if it does not work then use @import instead of #import . Actually I faced same issue while building xmppframework in my app so I deleted the line and then write import again then it worked – Pandey_Laxman Aug 03 '16 at 10:45
  • @import will be followed by Framework name without any quotes and <> brackets. So there is no question of using @ instead of # – Jayprakash Dubey Aug 03 '16 at 11:15
  • So you have source codes & project file of CommonLibrary, is it right? Can you show me the project tree of your workspace? – Harrison Xi Aug 11 '16 at 03:32
  • @HarrisonXi : Source code and project file for CommonLibrary is correct and it has been throughly tested by Client. Due to confidentiality I cannot share it. – Jayprakash Dubey Aug 11 '16 at 07:54
  • @JayprakashDubey I want to know the project structure but not the source codes. Just let me know how do you put CommonLibrary project into LibraryTester project (or worksapce). – Harrison Xi Aug 12 '16 at 02:17
  • @HarrisonXi : I've updated question with Framework structure. Check and if there is any solution let me know. – Jayprakash Dubey Aug 12 '16 at 05:41

6 Answers6

10

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

Community
  • 1
  • 1
lingyfh
  • 1,363
  • 18
  • 23
3

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.

Harrison Xi
  • 766
  • 1
  • 5
  • 23
2

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

Basheer
  • 1,207
  • 9
  • 10
1

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.

Andrew
  • 1,088
  • 10
  • 21
1

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.

mackworth
  • 5,873
  • 2
  • 29
  • 49
1

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.

Ravi Panchal
  • 1,285
  • 10
  • 22