Incremental compilation has been disabled: it is not compatible with whole module optimization on Release build configuration

Hey Developers I'm facing some strange situation, I'm getting multiples issues related to optimization on Release build configuration, I'm using Xcode 13.2.1

project is separated in 4 markets and multiples frameworks none of the markets have dependencies from each other, issue only appears when the market RefrreshAtPumpAUS Release is build, on the other side for Debug everything is functional and the app build fine.

here's my Podfile:

in order to add the : def adobe_manager_pods into the framework: CoolMasterUtilsFramework

as the project is in 4 different markets had to added in the different markets like this: 

  target 'RefrreshAtPumpNL' do
     
    # Pods for RefrreshAtPump
    common_pods
    adobe_manager_pods --> here
   
  target 'RefrreshAtPumpUS' do
   
   # Pods for RefrreshAtPump
   common_pods
   firebase_pods
   adobe_campaign_pods
   adobe_manager_pods. --> here
   
  target 'RefrreshAtPumpUK' do
   
    
   # Pods for RefrreshAtPump
   common_pods
   adobe_manager_pods --> here

but for the AUS market(RefrreshAtPumpAUS) is quite different already had added similar PODS

  target 'RefrreshAtPumpAUS' do
   
   # Pods for RefrreshAtPump
   common_pods
   firebase_pods
   adobe_experience_pods. ->> here

they have this so, I added the 2 remaining that I needed for that specific market.

  def adobe_experience_pods
   pod 'AEPAudience', '~> 3.0’ ------->> THIS ONE
   pod 'ACPUserProfile', '~> 2.2’ ------->> THIS ONE
   pod 'AEPEdgeIdentity', '~> 1.0'
   pod 'AEPEdgeConsent', '~> 1.0'
   pod 'AEPCore', '~> 3.0'
   pod 'AEPIdentity', '~> 3.0'
   pod 'AEPSignal', '~>3.0'
   pod 'AEPLifecycle', '~>3.0'
   pod 'AEPUserProfile', '~> 3.0'
   pod 'AEPEdge', '~> 1.0'
   pod 'AEPMessaging', '~> 1.0'
   pod 'AEPAssurance', '~> 3.0', :configurations => ['Debug']
  end

so if I run the project in all other markets as RELEASE or DEBUG everything goes well, but only for RELEASE on RefrreshAtPumpAUS

shows errors like this: 

I've tried

adding lines inside the RefrreshAtPumpAUS like this:

1.- post_install do |installer|

2.- Pod update

3.- delete all Derived data

4.- in Build settings -> Apple Clang - Code generation -> Optimization level to None[-O0]

5.- in Build settings -> Build active architecture only -> ALL to YES

6.- in podfile -> delete this line use_frameworks! and adding use_modular_headers! 

7.- in Build settings -> Swift compiler -> Code generation -> Incremental to all

Found any solutions? The same problem started happening to me when I updated XCode to version 13.2.1.

The same problem for me started when I updated XCode 13.3

I'm facing the same issue on Xcode 13 version. Has anyone found a fix?

I'm also facing the issue after updating Xcode to 13.3. The project compiles and runs fine without any problem, but whenever I try to generate the Archive to upload to TestFlight, it is throwing this error: "error: Abort trap: 6. Remark: Incremental compilation has been disabled: it is not compatible with whole module optimization. Command CompileSwiftSources failed with a nonzero exit code."

Same here ... No solution yet ?!

Same here, i use xcode 13.3

After 3 days of headache, I installed the previous version 13.2 of XCode, I can FINALLY compile in Archive.

Same here, 13.1 -> OK, 13.3 -> Failure

So I get this error as well. I use Flutter and the error ist thrown in two of the packages I use - so not my code - when I try to archive my project (just like this answer Incremental compilation has been disabled: it is not compatible with whole module optimization on Release build configuration - ( https://developer.apple.com/forums/thread/701981 ). I checked my configuration and it's the same as yours. But since I get this error in XCode 13.3 when archiving on my mac AND when I try to build via Codemagic I'm inclined to believe, this has nothing to do with my configuration or settings. I've read on other questions regarding this problem in the past that some people could solve this issue by making some changed in their code. So in my case could it be due to the packages I use? So I downgraded to 13.2.1 and it works on my machine and in Codemagic.

pod deintegrate pod install

This two lines fixed the problem for me

remark: Incremental compilation has been disabled: it is not compatible with whole module optimization Command CompileSwiftSources failed with a nonzero exit code

I have also got this issue and i was able to archive prior to the updation of the pods. When i last updated the pods, it started showing above error.

Anyone able to build archive?

Got solution on the above issue. Please follow the below steps:

  1. Open terminal
  2. Move to the directory of your project
  3. Deintegrate pod
  4. Remove workspace manually
  5. Remove pod file, pod.lock file, Pods folder manually
  6. pod init - terminal
  7. pod install
  8. Open workspace in Xcode
  9. Pods > General > Target > 12.0

IMPORTANT: Let processing complete for the device in Xcode. Worked on XCode 13.2.1

The same problem, caused by upgrading xcode, xcode version 13.3, flutter version 2.8.1.

Solution 1:

Downgrade xocde to 13.2.1

Solution 2:

My computer is M1, so it may not be suitable for you:

1、Delete the pod directory

2、sudo gem pristine ffi --version 1.15.3

3、pod install

4、Open workspace in Xcode ,Pods > Target > 11.0

Test time 2022-04-07 00:30, I only know Chinese, these words are translated by Google

This happened for me as well on 13.3.1. I tried the suggestions here and eventually just had to downgrade in order to build for release.

I have a solution!!!

Just change iOS version for minimal iOS 11 for problems pods. I found this solution on China forum =) I hope this helps you because it helped me, but none of the solutions worked before.

Incremental compilation has been disabled: it is not compatible with whole module optimization on Release build configuration
 
 
Q