Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App created by Archive cannot run on devices. #240

Closed
hxdev opened this issue Jul 24, 2015 · 17 comments
Closed

App created by Archive cannot run on devices. #240

hxdev opened this issue Jul 24, 2015 · 17 comments

Comments

@hxdev
Copy link

hxdev commented Jul 24, 2015

I face with a strange problem, I can Run or Build my project which added the ios-charts but when I try to Archive, it's Archive successful, after Export by Adhoc and install on devices, the app with force close when open. Any one face same problem?

@liuxuan30
Copy link
Member

does your Export by Adhoc mean in-house distribution or the 'Save for Ad Hoc Deployment'?

If so, you need to check your production cert, checkout:http://stackoverflow.com/questions/30867698/app-with-objective-c-and-swift-code-crash-at-launch-in-release-mode-debug-mode/30881865#30881865

In short: your cert is generated before swift born, so it lacks one attribute, and you need to generate a new cert and let your provisioning file use the new cert.

github issue is here:#154

@hxdev
Copy link
Author

hxdev commented Jul 24, 2015

@liuxuan30 Yes, you right! I use the in-house distrubution. Look like your explaination is make sense, I'll try that solution on monday and feedback soon. Thank you!

@liuxuan30
Copy link
Member

@hxdev it can be quickly checked if you take a look at your cert in key chain. Once you can confirm you lack the attribute 'OU' in your cert, then the solution is there. All the information and logs and checking steps are listed in stack overflow and #154.

@danielgindi
Copy link
Collaborator

It could also be related to not adding as an Embedded Framework, see README

@liuxuan30
Copy link
Member

@danielgindi Can it be archived successfully without adding as embedded framework? I wonder if not adding as embedded framework, it won't build at all.

@danielgindi
Copy link
Collaborator

If you are building as a Framework, and have not dragged the code to the project, then it must be added as an Embedded framework. Otherwise the compiler does not actually embed the framework's code in the project - assuming it is available in the OS like any other framework - and will crash on runtime when it cannot load the library.

@liuxuan30
Copy link
Member

It is interesting that compiler does not complain framework is not found while compiling...

@danielgindi
Copy link
Collaborator

danielgindi commented Jul 27, 2015 via email

@liuxuan30
Copy link
Member

I see. Thanks. Wait for @hxdev to reveal the answer!

@hxdev
Copy link
Author

hxdev commented Jul 28, 2015

Sorry for lately feedback, I'm working on a project with provisioning file was provided by customer, I've check the OU property and see that it's missng, I'll try @liuxuan30 solution.

@danielgindi My project write in ObjC and support iOS 7+, so that mean I must drag the Charts folder to my project only or drag folder and the drag the Charts.xcodeproj too? I've create a new target with name "Adhoc-Debug" and Archive with this target, do I need to add an target "Adhoc-Debug" for Charts project too? Because sometimes I got the "Charts/Charts.h file not found" when Archive or run UnitTest.

screen shot 2015-07-28 at 2 41 19 pm

@danielgindi
Copy link
Collaborator

You need to go to the "Build Phases" of your "Adhoc-Debug" target and add the Charts library there like you add any framework

@hxdev
Copy link
Author

hxdev commented Jul 28, 2015

Sorry for my mistake, I mean the Build Config not Target, it's duplicate of Debug build config.
So for UnitTest target, I also need to add Charts to the Link Binary With Library?

@danielgindi
Copy link
Collaborator

Whenever you want to run something that uses a framework which is not built in in the OS, you need to link to it (Embedded Frameworks, Link Binary With Library, etc.)

@hxdev
Copy link
Author

hxdev commented Aug 21, 2015

Finally, it's working perfect with new provisioning file which support Swift. Thanks so much for your support @liuxuan30

@liuxuan30
Copy link
Member

No problem!

@abraxascorner
Copy link

@liuxuan30 thank you. This thread helped me to solve my problem. 👍

@liuxuan30
Copy link
Member

@abraxascorner no problem, glad to hear it works and helping more and more people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants