7

This problem is driving me insane. Whatever I do, I get the problem "No such module 'Armchair'" when I archive. It works when I build but when I archive XCode messes with me. I see XCode archiving/compiling Armchair.

  • I have added $(PROJECT_DIR)/AppName/External/Armchair/build/Release-iphoneos to Framework Search Paths.
  • I have added the framework in Embedded binaries
  • I have added the framework in Linked Frameworks and Libraries
  • I have also tried with adding the framework to copy frameworks in my Build Phases
  • I have tried by adding the Armchair framework to my workspace instead and only added & coping the framework from there.

I think I have even tried a raindance, just to be sure. It keeps refusing to work when archiving, but works for normal building and running on device.

I have read and tried these related questions:

Running XCode 7.1. Any suggestions on how to solve it?

Community
  • 1
  • 1
Paul Peelen
  • 10,073
  • 15
  • 85
  • 168
  • Can you post a dozen or so lines of the raw build output from just before the error message? Also, sanity check: have you checked the build logs to see what `$(PROJECT_DIR)/AppName/External/Armchair/build/Release-iphoneos` expands to during the build, and verified that the file actually exists? – Paul Cantrell Oct 28 '15 at 03:46
  • are you using cocoapods? – vinbhai4u Oct 28 '15 at 19:49
  • @vinbhai4u I am in the project, but not for Armchair since they don't support Cocoapods. – Paul Peelen Oct 28 '15 at 19:50
  • @PaulCantrell I can pull out some stuff tomorrow and add it to the question. Yes, the folder does exists and so does the framework within it. – Paul Peelen Oct 28 '15 at 19:51
  • @PaulPeelen - have you seen this? http://stackoverflow.com/questions/29500227/xcode-no-such-module-error-but-the-framework-is-there – Squiggs. Nov 02 '15 at 09:31
  • @Paul I've seen that one too. I've boiled it down to that something is wrong in my Pre-Release profile. Archiving using my "Release" profile works, running using "Debug" works as well... however archiving using "Pre-Release" doesn't. I can't seem to find what differs, but something does and I'll find it. – Paul Peelen Nov 02 '15 at 09:46

1 Answers1

7

Ok, I figured it out. Its was too simple and kind of a stupid reason if you ask me.

My core app three configurations:

  • Debug
  • Release
  • Pre-Release

The framework I added into my app, in this case Armchair, has only the Debug and Release configuration. When I archive my app, the Pre-Release configuration is used, which doesn't exist for the included Armchair.xcodeproj. Added the Pre-Release configuration to the Armchair.xcodeproj solved my problem.

Paul Peelen
  • 10,073
  • 15
  • 85
  • 168
  • Thank you SO much for this! I'm definitely filing a radar for this one. Almost went nuts trying to chase the reason for why one of our frameworks was archiving fine while the other wasn't. – MrAlek Dec 01 '16 at 11:58
  • For me the issue was with the auto-generated "Pods" project from CocoaPods. Adding my custom build configs here fixed the issue. – Jacob King Mar 01 '17 at 14:54