The project builds and runs, but does not archive

I have a project that builds and works fine on the simulator and device, but does not work when archiving.

The project is very old, but I created a separate component that I added in the workspace.

The main project is written in Objective-C, the new project is written in Swift 4. The project also uses CocoaPods, and also includes another subproject written in Swift 3.2.

There are various errors that all boil down to the same thing; a subproject does not produce any output when compiling it. OR it just doesn't compile. I see no errors in the code itself, just trying to reference it:

//1 error: /Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/Intermediates.noindex/ArchiveIntermediates/<app name>/BuildProductsPath/Release-iphoneos/Framework.framework: No such file or directory` //2 Signing Identity: "iPhone Developer: <redacted>" /Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/Intermediates.noindex/ ArchiveIntermediates/<app name>/InstallationBuildProductsLocation/Applications/<app name>/Frameworks/<framework>.framework: No such file or directory Command /usr/bin/codesign failed with exit code 1 //3 @import ModuleName; Module 'ModuleName' not found 

Here is what I tried:

  • Clear derived data
  • Mac reboot
  • Add $(SRCROOT) to the main target> Build Options> Database Search Paths> Release
  • Confirmed project is present in the built-in binaries.
  • The confirmed project is present in related structures and libraries.
  • Removing and re-adding a project to embedded binaries and frameworks and libraries
  • Delete import declaration
  • I open a workspace, not a project
  • Skip install installed in YES in Subproject build settings
  • Comparison of assembly settings from a working subproject with unsuccessful (they are the same)
  • Running pod update
  • Changing Always Embed Standard Swift Libraries doesn't matter anyway

Other notes:

  • There is a .framework file in /Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/ Intermediates.noindex/ArchiveIntermediates/<app name>/ InstallationBuildProductsLocation/Applications/<app name>.app/Frameworks/ . for another subproject and all containers, but not for this
  • There is podfile use_frameworks!

Update:

After starting the archive today, I see only an error:

 Module 'ModuleName' not found 

Other errors have disappeared

+9
source share
3 answers

The problem was setting up iOS Deployment Target :

  • Main project: iOS 10
  • Subproject: iOS 11

In Debug it is built only for the current architecture; in Release it is built for everyone. Obviously, as soon as you know.

Setting up a subproject for assembly for iOS 10 fixes the problem.

The most disappointing part: I double-checked the build log and does not mention the version issue :(

+6
source

It is impossible to say what exactly caused the archiving to fail. BUT I'm sure I can give you the right direction =]

Running on a simulator or even on a real device - compiles the project for " Debugging "

Archiving is tough, compiles for " Release "

I bet that if you establish that the work on the simulator will compile in release mode, it will not succeed!

Screenshot of xCode Run configuration

Check this!!

If I fix it, you just need to set some Build Settings for the release to fit the debugging

My first guess: all search paths ( Framework search path and Runpath search path )

I saw similar behavior here

I still got it in the archive.

It looks like there is no Adhoc build configuration in the SDK-Project. Which project is used to archive the project for a specific assembly scheme. I think the compiler was looking for modules along the path $ (CONFIGURATION) $ (EFFECTIVE_PLATFORM_NAME)

+5
source

I had this error, and although my deployment goals did not match, it was not a fix for me. I added a new build configuration that I was trying to use for my archive, but I forgot to run pod install after adding. After starting pod install I was able to archive my application normally, although the deployment objectives for some modules are iOS 10, and the main purpose of the application is iOS 11.

0
source

Source: https://habr.com/ru/post/1273712/


All Articles