Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module file was created by an older version of the compiler; rebuild 'RealmSwift' and try again #2761

Closed
jgonfer opened this issue Oct 29, 2015 · 15 comments
Assignees
Labels

Comments

@jgonfer
Copy link

jgonfer commented Oct 29, 2015

When I build the project, I'm getting this error:

Module file was created by an older version of the compiler; rebuild 'RealmSwift' and try again

I've installed 'RealmSwift' 0.96.2 via CocoaPods, and I'm using Xcode 7.1 (7B91b). I've deleted all content in DerivedData, and cleaned up the project, but I'm still getting this error when I build the project.

@mrackwitz
Copy link
Contributor

Which version of CocoaPods do you use?
Can you make sure to use the same Xcode application path as the one which is selected for command line tools? (sudo xcode-select --reset)

@mrackwitz mrackwitz self-assigned this Oct 29, 2015
@jgonfer
Copy link
Author

jgonfer commented Oct 29, 2015

I'm using CocoaPods v0.39.0.

I'll run your command (sudo xcode-select --reset) when I get home. I'll let you know when I have more information. Thanks Marius!

@realm-ci realm-ci removed the pending label Oct 29, 2015
@jgonfer
Copy link
Author

jgonfer commented Oct 29, 2015

I've run the command (sudo xcode-select --reset) but I'm still getting the same error:

captura de pantalla 2015-10-29 a las 15 16 07

@mrackwitz
Copy link
Contributor

Did you tried to clean DerivedData after that change once again?
If not, could you try to reproduce the issue in an example project you could share?

@jgonfer
Copy link
Author

jgonfer commented Nov 2, 2015

I've made some changes in the project. RealmSwift for watchOS was imported manually, and for others targets it was imported by Cocoapods. Now RealmSwift is imported by Cocoapods for all the targets.

After doing this, I'm getting a different error for Realm framework when I'm archiving (but not when building):

LLVM ERROR: Symbol name entry points before beginning or past end of file.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil failed with exit code 1

captura de pantalla 2015-11-02 a las 8 28 44

@realm-ci realm-ci removed the pending label Nov 2, 2015
@mrackwitz
Copy link
Contributor

That's a new one. Never saw that before. Could you try resetting the CocoaPods cache by rm -rf "~/Library/Caches/CocoaPods" and run pod install again? Perhaps you have to run it twice then, due to #2701.
If that shouldn't help, can you try to reproduce the issue in a sample project you could share with us? (help@realm.io)

@jgonfer
Copy link
Author

jgonfer commented Nov 2, 2015

I reseted the CocoaPods cache and now I'm getting this error messages:

CreateUniversalBinary /Users/jgonfer/Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/ArchiveIntermediates/B2B/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Realm.framework/Realm normal armv7\ arm64
    cd "/Users/jgonfer/Documents/iOS Projects/B2B/Pods"
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo -create /Users/jgonfer/Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/ArchiveIntermediates/B2B/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-B2B\ Free-Realm.build/Objects-normal/armv7/Realm /Users/jgonfer/Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/ArchiveIntermediates/B2B/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-B2B\ Free-Realm.build/Objects-normal/arm64/Realm -output /Users/jgonfer/Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/ArchiveIntermediates/B2B/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Realm.framework/Realm

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't move temporary file: /Users/jgonfer/Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/ArchiveIntermediates/B2B/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Realm.framework/Realm to file: /Users/jgonfer/Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/ArchiveIntermediates/B2B/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Realm.framework/Realm.lipo (No such file or directory)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo emitted errors but did not return a nonzero exit code to indicate failure

captura de pantalla 2015-11-02 a las 22 51 06

Could be this issue related to #3493 of CocoaPods?

I'm not sure if I'll able to reproduce the project's issue because it's a "complex" project. I'll try it.

@realm-ci realm-ci removed the pending label Nov 2, 2015
@mrackwitz
Copy link
Contributor

Well, the root cause of the CocoaPods issue, you link to, should be solved through the target de-duplication. But in some scenarios, it isn't applicable, so it might still help to turn off Parallelized Builds. Can you test whether that has helped for you? Otherwise some more information about the complexities of your project would be useful, eg. your Podfile.

@jgonfer
Copy link
Author

jgonfer commented Nov 2, 2015

Parallelized Builds turned off, but now I'm getting this:

PhaseScriptExecution Embed\ Pods\ Frameworks /Users/jgonfer/Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/B2B.build/Debug-iphoneos/B2B.build/Script-66BE071508E4BCA949337419.sh
    cd "/Users/jgonfer/Documents/iOS Projects/B2B"
    /bin/sh -c /Users/jgonfer/Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/B2B.build/Debug-iphoneos/B2B.build/Script-66BE071508E4BCA949337419.sh

/Users/jgonfer/Library/Developer/Xcode/DerivedData/B2B-dknnmkplfuhntmbjfxavlmufuiif/Build/Intermediates/B2B.build/Debug-iphoneos/B2B.build/Script-66BE071508E4BCA949337419.sh: line 2: /Users/jgonfer/Documents/iOS Projects/B2B/Pods/Target Support Files/Pods/Pods-frameworks.sh: No such file or directory

captura de pantalla 2015-11-03 a las 0 17 18

I understand that this is more an issue related to CocoaPods than to Realm , isn't it?

@realm-ci realm-ci removed the pending label Nov 2, 2015
@jpsim
Copy link
Contributor

jpsim commented Nov 6, 2015

@mrackwitz could this be due to the CocoaPods script bug you mentioned in another issue about not supporting paths with spaces? This project is in a path containing iOS Projects.

@mrackwitz
Copy link
Contributor

@jpsim: This could be indeed the case. Thanks for taking a second look, I was a bit stumped here. But took a second look now and tried to reproduce it, but no luck with that.

@jgonfer: Did you checked manually whether the referenced file exists? If not, something must be really went wrong with your CocoaPods integration. Could you in that case report the output of tree Pods/Target Support Files in your project directory? Additionally you could try to use cocoapods-deintegrate to reset your integration to a clean state and then run pod install again.

@mrackwitz
Copy link
Contributor

As we didn't got any further info on that, I'll assume that it is resolved and close this issue. If that wasn't the case, please feel free to re-open it. Otherwise it'd be also helpful for us to get to know how you could resolve the issue.

@hcientist
Copy link

hcientist commented Jul 9, 2016

This problem is tripping me up still.

/Users/tgm/dev/project-name/ProjectName/RedactedViewController.swift:14:8: Module file was created by an older version of the compiler; rebuild 'RealmSwift' and try again: /Users/tgm/dev/project-name/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftmodule

There are no spaces in my path, here's the output of ls (is that similar enough to tree?):

~/dev/project-name [feature/realm-db|✚ 35⚑ 3] 
11:41 $ ls Pods/Target\ Support\ Files/
BrightFutures      Pods-ProjectName      SIOSocket          ionicons
MMDrawerController Result             Sheriff

I've created the repo/project/workspace here to try to help demonstrate the issue: https://github.com/thegreatmichael/BreakRealm

unfortunately I also have a different issue in that one:

/Users/tgm/dev/BreakRealm/BreakRealm/Pods/Realm/include/realm/group.hpp:30:10: 'realm/util/features.h' file not found

I think I fixed this with pod update RealmSwift

@elvinaze
Copy link

You probably need to delete ~/Library/Developer/Xcode/DerivedData to clear out your old build products.

@voghDev
Copy link

voghDev commented Jan 22, 2024

I landed here while facing the same issue many years later, so I'll add our solution as it may help anyone else.
In our case we use Tuist + SPM and we have Realm.xcframework and RealmSwift.xcframework directly copied inside the Dependencies folder. The only way that allowed us to run the App after updating to Xcode 15.0.1 was deleting the two folders (Dependencies/Realm.xcframework, Dependencies/RealmSwift.xcframework) and replacing them with the ones from release 10.45.0. Other releases were leading to the same error, only 10.45.0 worked for us. We also deleted DerivedData folder several times during our trial and error process, as it is said in various comments here.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants