Realm Swift 0.92.3 “Run Script Phase” not working

穿精又带淫゛_ 提交于 2019-12-23 07:48:14

问题


Trying to use the new realm-swift-0.92.3, I can't get this “Run Script Phase” to work. I follow the instructions from here.

My Run-Script entry according to the the instructions is (see image below):

Unfortunately, I still get the following error message while trying to compile (see below). What could still be wrong ???

bash: /Users/XXX/Library/Developer/Xcode/DerivedData/MyAppglnkfueqyjbdhurfurfkip/Build/Products/Debug-iphonesimulator/MyApp.app/Frameworks/RealmSwift.framework/strip-frameworks.sh: No such file or directory

My Framework-Search-Paths is also set, as follows: /Users/XXX/.../MyApp/Frameworks/RealmSwift.framework/Frameworks

I appreciate any help on this !


回答1:


Make sure your framework is added to the Embedded Binaries and Embed Frameworks.

While this is the first step that you're supposed to do: "Go to your Xcode project’s “General” settings. Drag RealmSwift.framework from the ios/ or osx/ directory to the “Embedded Binaries” section. Make sure Copy items if needed is selected and click Finish.", for some reason it didn't add it there for me, just to the project.




回答2:


Make sure that in the Build Phases Run Script is after Embed Frameworks. I got the build errors when Run Script was before Embed Frameworks.




回答3:


For those who tried everything and still not working - this worked for me:

1) Go over Xcode where you see the error and copy this portion of the directory where it says no such file or directory: Using example above: Users/XXX/Library/Developer/Xcode/DerivedData/MyAppglnkfueqyjbdhurfurfkip/Build/Products/Debug-iphonesimulator/

2)Copy that and place it on the top right of your MAC to search for that directory

3)Once you found that, you gonna go to that directory and find an application that is named exactly as your app(i.e MyApp) and is going to have like an invalid white circle with a line across it.

4) Right click that and go to show package contents.

5)You going to find a folder named Frameworks there.

6)Go ahead and drop both Realm.framework & RealmSwift.framework

7)Build should succeed in Xcode afterwards.




回答4:


Make sure that in the Build Phases Run Script is after Embed Frameworks. I got the build errors when Run Script was before Embed Frameworks.




回答5:


For me, I had a different bash script running. After I changed the order (placed realm's one before) it worked



来源:https://stackoverflow.com/questions/30226810/realm-swift-0-92-3-run-script-phase-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!