8
votes

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):

enter image description here

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 !

5

5 Answers

8
votes

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.

enter image description hereenter image description here

32
votes

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. enter image description here

7
votes

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.

1
votes

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.

0
votes

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