Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Realm Swift 0.92.3 "Run Script Phase" not working

Tags:

xcode

ios

realm

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 !

like image 269
iKK Avatar asked May 13 '15 23:05

iKK


3 Answers

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

like image 73
Markus T. Avatar answered Sep 21 '22 04:09

Markus T.


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

like image 23
pteofil Avatar answered Sep 23 '22 04:09

pteofil


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.

like image 24
Manny Avatar answered Sep 19 '22 04:09

Manny