RxSwift icon indicating copy to clipboard operation
RxSwift copied to clipboard

use cocoapod

Open hatjs880328 opened this issue 10 years ago • 19 comments

Module file was created by an older version of the complier;rebuild 'RxSwift' and try again :.............../X86_64.swiftmodule

hatjs880328 avatar Mar 29 '16 09:03 hatjs880328

Xcode version is 7.3

hatjs880328 avatar Mar 29 '16 09:03 hatjs880328

Hello @hatjs880328, can you please try to clean the build folder or even delete the derived data and try to build again?

If it doesn't work, can you give more details about this error, such as:

  • Toolchain used in Xcode (you can see it under Xcode -> Toolchains
  • Cocoapods' version
  • More details about the Podfile
  • Example of the code importing the RxSwift module

With all these information I think I can try to reproduce the error.

bontoJR avatar Mar 29 '16 09:03 bontoJR

pods version is 0.39.0

podfile like :+1:

source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks!

pod 'SnapKit', '~> 0.19.1'

pod 'Alamofire', '~> 3.1.5'

pod 'RxSwift', '~> 2.3.1'

pod 'RxCocoa', '~> 2.3.1'

pod 'RxBlocking', '~> 2.3.1'

pod 'RxTests',    '~> 2.3.1'

hatjs880328 avatar Mar 29 '16 09:03 hatjs880328

set Bitcode enabled show : cannot load module 'rxswift' as 'rxswift'

hatjs880328 avatar Mar 29 '16 09:03 hatjs880328

ld: '/Applications/xcode7.3/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

hatjs880328 avatar Mar 29 '16 09:03 hatjs880328

It sounds like a very strange problem considering that since 7.1 I never saw it anymore, I can't reproduce the problem, maybe @orta or @neonichu might have an idea how to solve this?

bontoJR avatar Mar 29 '16 12:03 bontoJR

Haven't seen this ever so ¯_(ツ)_/¯

neonichu avatar Mar 29 '16 12:03 neonichu

@neonichu @orta

hatjs880328 avatar Mar 30 '16 00:03 hatjs880328

Hi @hatjs880328,

according to

ld: '/Applications/xcode7.3/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

and Podfile, I would say that you are trying to include RxTests in non test target, and that's causing an issue.

I would suggest using new Cocoapods target syntax for defining dependencies so you can limit that RxTests are applied only to unit tests target.

kzaher avatar Mar 30 '16 21:03 kzaher

@kzaher As far as I can tell, this is an actual issue anytime you're building for device with RxTests in the project, as XCTest does not include bitcode. Can we just change the build flag in the Rx project to disable bitcode for the test utility components?

tomburns avatar Apr 04 '16 14:04 tomburns

Hi @tomburns ,

I guess we could, but I'm little confused. Last time I've tried to run unit tests on device:

screen shot 2016-04-04 at 23 29 19

kzaher avatar Apr 04 '16 21:04 kzaher

Anyway, I think we can close this one, unsure what to more here. I think this was caused by using RxTests in app binary.

We can open new issues if this pops up in future.

kzaher avatar Apr 20 '16 18:04 kzaher

@kzaher FWIW this is still an issue; I've worked around it by adding a post-install hook to my pod file, but it would be much simpler to simply disable bitcode for the RxTests target and I don't see what the harm would be. You're correct that you can't run framework logic tests on device, however you can run unit tests injected into an application bundle on device, which is where I ran into this issue.

tomburns avatar Apr 21 '16 22:04 tomburns

RxBlocking's bitcode should be disabled as well if you decide to change them; as I understand it both are purely meant for use in test bundles, so this should be an acceptable change (until XCTest supports bitcode)

tomburns avatar Apr 21 '16 22:04 tomburns

Hi @tomburns ,

I'm little confused, if you install using CocoaPods, it shouldn't make any difference if I turn bitcode on or off in project, right?

We are open to PRs. I'm not sure what action are you suggesting we should take. Bitcode is disabled for RxTests.

kzaher avatar Apr 21 '16 22:04 kzaher

Is there any way of disabling bitcode in podspec?

kzaher avatar Apr 21 '16 22:04 kzaher

I think you can add this line of code in your pod spec.

s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' }

Reference

retsohuang avatar Apr 26 '16 19:04 retsohuang

Thnx @retsohuang ,

I'll include this in RxTests for 2.5 because XCTest doesn't have bitcode turned on, and we can see how that will go :)

kzaher avatar May 15 '16 14:05 kzaher

Attempt #2 to close this issue. Feel free to reopen it if it's not working :)

kzaher avatar May 15 '16 18:05 kzaher