Closed xiles closed 9 years ago
@xiles, with what version of RealmSwift was this happening for you? What are your iOS/OS X deployment targets?
Having the same issue with RealmSwift 0.92.2.
RealmSwift 0.92.2 Deployment Target iOS 8.0
@xiles @michaelloistl one more question: how are you including RealmSwift in your project? Are you using the pre-built binary in the release zip, Carthage, CocoaPods, etc.?
As a dynamic framework. As i wrote in first comment, i followed exact steps in documentation.
As a dynamic framework as well (due to troubles with cocoapod's framework support in connection with other pods). Double checked every step several times with you install doc.
Sorry I can't help with why this doesn't work for you – but this is working for me. I have installed RealmSwift 0.92.2 with cocoapods and it codesigns and submits the build to the store fine so there must be something else wrong there. Hope that helps isolate the issue as at least it is working for me.
I'd guess the users having problems here are the ones using the pre-built dynamic frameworks for iOS, as distributed through:
So CocoaPods users would be unaffected here.
Any workaround without using CocoaPod? I was about to release an update of my app 😭
So, two issues at play here:
1) The strip-frameworks.sh
scripts have a shebang at the top, and thus iTC wants to see them signed. Easy fix: remove the shebang.
2) The iOS app store doesn't seem to allow nesting bundles (and thus nesting frameworks), so we'll need to ship Realm.framework
alongside RealmSwift.framework
, instead of inside of it.
I'd expect that moving away from nested frameworks will actually greatly simplify installation, as well as avoiding some name tool hackery.
I think having to include both frameworks will be annoying. I think it would be better to compile the static Realm.framework into RealmSwift.framework and vendor the Realm headers in a second Realm module. Then users would only have to drag in a single framework to use Realm or RealmSwift. I'm not sure if this will work, but if it does it will be a better experience so might be worth trying.
You're right that it would definitely be a better experience, but you'll recall that several people, you and I included, attempted to do this without success. And I really think that dragging two frameworks into a project as opposed to one is a negligible difference in user experience compared to not having it work at all.
I have actually never tried this approach as we were originally committed to building from source. Not sure exactly what you have tried, but I wouldn't be surprised if there were issues. Do you remember what the problem was?
I don't know if it's related but I've just tried to compile my app with RealmSwift and I get this:
/Users/danielemm/Library/Developer/Xcode/DerivedData/Shake-ajzskdhbojclfuhenmckcziroqxk/Build/Intermediates/Shake.build/Debug-iphonesimulator/Shake.build/Script-64D8CA911AFCF80300E40B07.sh: line 2: /Users/danielemm/Library/Developer/Xcode/DerivedData/Shake-ajzskdhbojclfuhenmckcziroqxk/Build/Products/Debug-iphonesimulator/Shake.app/Frameworks/RealmSwift.framework/strip-frameworks.sh: No such file or directory
Seems stip-frameworks.sh was removed but something try to use it. (Just to be sure but I think it's not the case, I've already done a clean & build, removed and reinstalled pods and deleted derived data directory)
Ok solved, maybe the old version on CocoaPods has installed this call as new Run Script in Build Phases of my project. Just removed, everything it's okay :)
Commenting to subscribe to the thread as I am having the same issue in 0.92.3.
Same issue for me in 0.92.3.
Is there a temporary quickfix available for this issue? Struggling to get my submission through.
EDIT: I switched over to CocoaPods and it went through just fine!
Should I drag the nested framework into its parent's directory?
The fix for me was to make sure that in your Build Phases, the "Run Script" is after the "Embed Frameworks" - if "Run Script" comes first then the Realm.framework isn't in the correct location yet.
Also, as of 0.93.2 there is no strip-frameworks.sh in RealmSwift.framework so you have to reference the Realm.framework instead in the Run Script.
Thanks @bendodson , your two suggestions worked for me. To reiterate (in case someone needs help understanding the steps), in Build Phases, you can drag "Run Script" beneath "Embed Frameworks". Then in the Run Script, change RealmSwift.framework (as originally instructed by the Realm installation instructions) to Realm.framework.
Thanks fpisidoro. I've been struggling with issue for a while. Dragging the "Run Script" was the trick.
Amazing @bendodson. Thank you for that easy fix.
I did installation steps in swift documentation. added Framework Search Path as $(PROJECT_DIR)/RealmSwift.framework/Frameworks
When I tried to submit to AppStore,
First, I got an error "Invalid Signature. Code object is not signed at all. The binary at path [MyApp.app/Frameworks/RealmSwift.framework/strip-frameworks.sh] contains an invalid signature. ...."
So I added following command in Build Phases > Run Script rm ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework/strip-frameworks.sh
Now I got this error. "Invalid Bundle. The bundle at 'MyApp.app/Frameworks/RealmSwift.framework' contains disallowed nested bundles." "Invalid Bundle. The bundle at 'MyApp.app/Frameworks/RealmSwift.framework' contains disallowed file 'Frameworks'."
Tested with Xcode 6.3.1, 6.3.2GM
Also tried: Set Embedded Content Contains Swift Code to YES in Build Settings