How do I successfully add RealmSwift to Xcode? - macos

I would like to add RealmSwift to an experimental Xcode project (for Mac OS X Yosemite) and have tried to follow the installation instructions on the Realm website.
I have downloaded the Swift version of Realm and dragged the framework to Xcode correctly.
I have set the Framework search paths to point to the new framework.
On trying to run, Xcode trips up with a code sign error, exit code 1.
I have not added anything else to a standard Xcode template / Cocoa (non-document) application using Swift and storyboards - its just a bog-standard appDelegate Xcode template at the moment without any added code other than the Realm framework. I have searched endlessly around SO and across the internet in general but most help out there concentrates on iOS.
I am using Xcode 6.3.2 build 6D2105 and OS X 10.10.4.
The error log looks like this:
Warning: usage of --preserve-metadata with option "resource-rules"
(deprecated in Mac OS X >= 10.10)!
/Users/bobavery/Library/Developer/Xcode/DerivedData/RealmTest-hffxikloaikapxcsotbcfqpezrba/Build/Products/Debug/RealmTest.app/Contents/Frameworks/RealmSwift.framework/Versions/A:
code object is not signed at all In subcomponent:
/Users/bobavery/Library/Developer/Xcode/DerivedData/RealmTest-hffxikloaikapxcsotbcfqpezrba/Build/Products/Debug/RealmTest.app/Contents/Frameworks/RealmSwift.framework/Versions/A/Frameworks/Realm.framework
Command /usr/bin/codesign failed with exit code 1
Any pointers would be very welcome!

i have this problem before.. and the documentation is working allright.. i think there something wrong on the way your adding the framework.. on a new xcode project.. Go to General.. Drag and Drop the framework on Embedded Binaries.. then add Run Script on Build Phases.. add also the path on Build Settings> Framework search paths like this>> $(PROJECT_DIR)/RealmSwift.framework/Frameworks add also other library needed for RealmSwift.... On the project make sure your import is RealmSwift.

Related

xcode-cloud-assertion failures when testing Xcode Source Editor Extension

So I have a bare-bones Xcode project with an Xcode Source Editor Extension target attached. I'd like to test the thing, so I hit run. A new instance of Xcode pops up, where my extension should appear in the Editor menu, but there's nothing there. The logs show the following lines (among other things):
2023-01-20 13:44:24.240562-0800 Xcode[2203:46831] [xcode-cloud-assertion] ❌❌❌ Assertion failure #0 in Failed SW AuthKit for: <private>
2023-01-20 13:44:24.249980-0800 Xcode[2203:46831] [xcode-cloud-assertion] ❌❌❌ Assertion failure #0 in Failed to authenticate account: <private> error: <private>
For context, I'm running the following:
macOS 12.6.2
MacBook Pro (Retina, 13-inch, Early 2015)
Xcode 14.0 (14A309)
I'm not enrolled in the Apple Developer Program, and I've never used Xcode Cloud.
It's also worth noting that when I go to Reports > Cloud, I get Analyzing workspace... for a few minutes before Could not load Xcode Cloud data pops up (same issue as described here). I get similar behavior across all projects, including brand new ones. I'm not sure if that has anything to do with these log messages above, but I kind of hope it does.
I've tried the following:
Removing and adding my Apple ID in Xcode, restarting my MacBook in between
Deleting my development certificates
The main thing is that I'd like to be able to test my source editor extension. Any ideas?
Found it. The problem is XcodeKit, which isn't set to sign out of the box. I was able to fix it by setting it to Embed & Sign under General > Frameworks and Libraries > XcodeKit.framework (see screenshot).

Xcode 7.0.1 - cannot run application cocoa error - 102

I've located an oddity:
On 10.10.5 I can open xcode, start a new project, iOS single view application, arbitrary product name, Swift as the language and all other values default, build and run the application.
As an admin, this executed as expected.
As a non admin user however it competes the build and then fails to run with the error "The operation couldn't be competed. (Cocoa error - 102.)"
I've checked permissions on everything and all looks well.
Can anyone point me to a fix?
I was able to fix this by removing all my extensions, doing a full clean, re-adding the extensions in the build-phases tab and then running the app again.

Unable to find APP_BUNDLE_PATH. Cannot find a built app that is linked with calabash.framework

I am running calabash-cucumber in xcode 5.0.1 on OSX 10.9.1, but getting this error while executing the test script. I have installed calabash framework successfully, but don't know why this error occurs.
Error... Unable to find APP_BUNDLE_PATH.
Cannot find a built app that is linked with calabash.framework
Please build your app from Xcode
You should build your calabash target.
Alternatively, specify APP_BUNDLE_PATH in features/support/01_launch.rb
This should point to the location of your built app linked with calabash.
(RuntimeError)
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.9.168/lib/calabash-cucumber/launch/simulator_helper.rb:178:in `app_bundle_or_raise'
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.9.168/lib/calabash-cucumber/launcher.rb:307:in `relaunch'
/Users/mymac/Desktop/myproject/myproj/features/support/01_launch.rb:29:in `Before'
Does your simulator or device contain the YourApp-cal target installed? Check weather you run the YourApp-cal target once from the xcode to install the app with calabash server on simulator or device.
Then Check you have followed setup Process
You need to have xcode tools installed too.
Check these things too.
Build the yourApp-cal target and run using xcode once.
While App is running open a Terminal(console) and type calabash-ios console. If your ruby environment is correct it will open you a ruby console.
In that console type
server_version['version']
and
Calabash::Cucumber::FRAMEWORK_VERSION
you should get something like "0.9.164"
calabash.framework is installed correctly in your app.
If so You should go to the file /YourProject/features/support/01_launch.rb open it check weather app bundle path is specified or not (if it is commented out calabash automatically detect the default app bundle path) if you are building your app to somewhere else than the default place you need to specify the appbundle path here in this file.
Tell us more details after check this list so we can help you more..
I hit the same issue, the way I got around to it is, on Xcode's top-right corner there is "Identity and Type" window. There you will find the full path of anything that you select on left (Project Explorer window).
Now usually on the ProjectExplorer window you should have "Classes", "Common", "Frameworks", "Other Sources", "Product", "Resources", "Scripts" etc. (It might be slightly different project by project). Inside "Product" is where your .app lives.
Select your app and you'll see the whole path on "Identity and Type" window.
Copy and paste it to "support/launch.rb" where it says APP_BUNDLE_PATH.
Should work now.
Edit 29/07/14: Do you see
HTTPServer: Started HTTP server on port 37265 on 'All output' window of Xcode (my version of Xcode is 5.1) when you build ?
There is a better way to set up calabash so you won't have this problem.
It involves creating a configuration, rather than a -calabash target. Basically you
1. create a configuration
2. add calabash framework to that configuration in build settings
3. add framework search path to find that framework
4. create a scheme to run calabash
The longer version can be found
http://fangmobile.com/2014/05/08/do-you-love-calabash-ios-but-hate-that-cal-second-target/
Deleting the contents of /Library/Developer/Xcode/DerivedData and compiling again solved this problem for me.
My error message was Unable to auto detect APP_BUNDLE_PATH.

Dock Tile Plug-in not working

I'm trying to create a dock tile plugin.
I've added a new Target to my project with Wrapper Extension as docktileplugin
I've added a Class that implements NSDockTilePlugIn with method:
-(void)setDockTile:(NSDockTile *)dockTile
{
NSLog(#"DOCK TILE PLUG-IN LOADED!");
}
I've set this class as Principal Class in its info.plist
I've set this new DockTile Target as a Target Dependency for my main application and I've added it to "Copy Files / Destinantion: Plugins" Build Phase
I've set the NSDockTilePlugin keyword in my Main Application's Info.plist as the name of the Dock Tile Target without extension.
I've followed the documentation, and even downloaded the example program that apple provides located:
http://developer.apple.com/library/mac/#samplecode/DockTile/Listings/DockTilePlugIn_DockTilePlugIn_m.html
The example program doesn't work, but I at least get a console error:
12/20/12 8:29:49.217 PM com.apple.dock.extra: Could not load Dock Extra class from the bundle /Users/[MYNAME]/Downloads/DockTile/build/Release/DockTileApp.app//Contents/PlugIns/DockTile.docktileplugin
Please help.
After much trial and error, I discovered that you must have the following build configurations for your dock tile plugin to run properly.
Other Linker Flags: -ObjC
OS X Deployment Target: 10.6 or above, depending on your current OSX version
Architecture: Standard (32/64-bit Intel)
#gravityab After much searching I found an unmaintained version and I've now updated it, added another feature to the sample and put it on github here - https://github.com/CartBlanche/MacDockTileSample. Feel free to fork or submit PRs if anyone notices I've done something wrong.

Firemonkey deployment folders on a Mac

I am new to Mac development and are trying to understand the location that XE2 firemonkey apps are deployed. I understand that the application is deployed into a "package" however I am not sure how this work when getting path information from within my app.
My application loads a dylib that I moved over from Visual Studio to XCode and initializes it by passing in a driver path (intended to be off the application path). i.e.
UDMXLibInit(PAnsiChar(AnsiString(driver_path))
If I put a breakpoint on this line in Delphi I find that driver_path is:
.../PAServer/scratch-dir/MacMini/LightFactory3.app/Content/MacOS/drivers
In my dylib I put a breakpoint in XCode on the "Init" function I find that the path is now:
.../PAServer/scratch-dir/MacMini/LightFactory3.app/Content
There appears to be some vodo that is truncating the path. Is this because "LightFactory3.app" is a package and there is something I dont understand or is there something else I am missing about passing this string between app and library under OSX?
Thanks in advance.
This appears to be a bug in the Expressions view for XCode 3.2. For some reason it truncates strings.
The actual string was correct - figure this out by passing it back to to my app.

Resources