0

I have made an app with swift which is working when I run it from XCODE. However, when i try to archive it and run the .app, it will not start.

How can I check why the app is crashing/not starting? What can be the reasons?

This is what the console output if I enter the packe and start it from the folder Contents/MACOs

Mislavs-MBP:~ proslav$ /Users/proslav/Desktop/trackingCore.app/Contents/MacOS
/trackingCore ; exit;
dyld: Library not loaded: @rpath/SQLite.framework/Versions/A/SQLite
Referenced from: /Users/proslav/Desktop/trackingCore.app/Contents/MacOS   
/trackingCore
Reason: image not found
Trace/BPT trap: 5
logout

running it from the terminal gives the following output

LSOpenURLsWithRole() failed with error -10810 for the file /Users/proslav
/Desktop/trackingCore.app.

I have added a framework https://github.com/stephencelis/SQLite.swift to access a SQLite database. That is the library that is not loaded although it exists in the .app

Silve2611
  • 2,198
  • 2
  • 34
  • 55
  • You could put some console printing stuff in and run it via the terminal to see what, if anything, is printing. – nhgrif Mar 17 '15 at 00:55
  • 1
    First, running an app using Xcode and running it after archiving are two different environments, development and production, I think. I used to have similar issues, but the reason behind may be different. Anyway, if you are using keychainwrapper stuff, that might be a cause. But, please provide more info before people can come up with ideas. – leonard Mar 17 '15 at 01:08
  • I added some more Information. I Understand the fact that they are two different enviroments. Yet I cannot tell why it is not working when I archive it. – Silve2611 Mar 17 '15 at 01:43
  • Are you linking to SQLite? http://i.imgur.com/qjvHqnE.png And the framework you mentioned. – nhgrif Mar 17 '15 at 01:52

2 Answers2

1

I found the answer. In the copy files i was linking to resources instead of frameworks. It seemed to be no problem for run but it was for archving.

Silve2611
  • 2,198
  • 2
  • 34
  • 55
1

Anyone arriving here based on the title, note that Xcode OSx builds are broken now.

https://developer.apple.com/library/mac/qa/qa1884/_index.html

They recommend using command line tools;

$ productbuild --component Sample.app /Applications --sign “3rd Party Mac Developer Installer:" Sample.pkg

$ sudo installer -store -pkg Sample.pkg -target /
Lorne K
  • 109
  • 7