Cocoapods: error: module file was created for incompatible target armv7-apple-ios8.0

Created on 22 Oct 2015  Â·  9Comments  Â·  Source: CocoaPods/CocoaPods

I have an iOS app with Watchkit Extension and in the last version I've started using Cocoapods to manage better the dependencies. I can build the project without problems and run it perfectly.

However when I try to archive the app with Watchkit Extension target to publish my app, I receive the following error:

error: module file was created for incompatible target armv7-apple-ios8.0: /Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/ArchiveIntermediates/B2B/BuildProductsPath/Release-watchos/Pods-B2B WatchKit Extension/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule
import Alamofire
       ^

I tested it with versions 0.39, 0.39.beta.4 and 0.39.beta.3 of Cocoapods, and it's still not archiving the app.

I'm using the podfile:

platform :ios, '8.0'

use_frameworks!
link_with 'B2B', 'B2B WatchKit Extension'
link_with 'B2B', 'B2B Free'

def shared_all_pods  
  pod 'Alamofire', '~> 3.0'
end

def shared_app_pods
  pod 'RealmSwift', '0.95.3'
  pod 'SwiftyJSON', '~> 2.3'
end

target 'B2B' do
  shared_all_pods
  shared_app_pods
  pod 'MMWormhole', '~> 2.0'
end
target 'B2B Free' do
  shared_all_pods
  shared_app_pods
end
target 'B2B WatchKit Extension' do
  platform :watchos, '2.0'
  shared_all_pods
  pod 'MMWormhole', '~> 2.0'
end

I also tried what #4369 says, but with no success results. I posted this issue in #4178 but it's an old post and maybe no one have read it.

Is there any solution?

awaiting input

Most helpful comment

This is an old one but I found it as I was googling around for answers. Had the same error message and figured out the problem, so wanted to contribute. If anyone stumbles here then hopefully the following helps.

Given that you have targets, dedicated to each platform, you should ensure the code your using on each target, is platform specific.

Firstly, I had a mixture of iOS and tvOS frameworks in 'link binaries with libraries'. Secondly, I had the following paths in 'framework search paths', for the tvOS target.

$(PROJECT_DIR)/Carthage/Build/iOS
$(PROJECT_DIR)/Carthage/Build/tvOS

So just do some house keeping in your targets and the error should clean itself up.

All 9 comments

This sounds as if there's leftover stuff compiled with a different version of Xcode in DerivedData — at least that's the context I have seen it in so far. Could you double-check if this occurs also when you delete DerivedData before building?

I've deleted all the content in Derived Data right now, and it is still showing the error only when archiving (if I run or build the project the error doesn't show up).

captura de pantalla 2015-10-22 a las 14 31 01

In that case, could you share a project that reproduces the archiving issue? Thanks!

I'll try to make a project reproducing the same behavior :)

Closing due to lack of response.

Anyone have a solution to this one?

I am also having a problem with this one. Any ideas?

This is an old one but I found it as I was googling around for answers. Had the same error message and figured out the problem, so wanted to contribute. If anyone stumbles here then hopefully the following helps.

Given that you have targets, dedicated to each platform, you should ensure the code your using on each target, is platform specific.

Firstly, I had a mixture of iOS and tvOS frameworks in 'link binaries with libraries'. Secondly, I had the following paths in 'framework search paths', for the tvOS target.

$(PROJECT_DIR)/Carthage/Build/iOS
$(PROJECT_DIR)/Carthage/Build/tvOS

So just do some house keeping in your targets and the error should clean itself up.

iOS 14

Was this page helpful?
0 / 5 - 0 ratings