KevinCoble / AIToolbox

A toolbox of AI modules written in Swift: Graphs/Trees, Support Vector Machines, Neural Networks, PCA, K-Means, Genetic Algorithms
Apache License 2.0
793 stars 87 forks source link

Abort with payload #8

Closed heuism closed 7 years ago

heuism commented 7 years ago

New issue dear Kevin,

Last week, i put the lib in successfully, But now it imported fine, but whenever i install the project by Xcode it always stuck here and said that abort with payload, which i dont get the reason why. At first i thought some of my project aren't working right. So i deleted and commented code and some thing like that. But everything still got this issue. Until i delete this subproject out of my project the code runs fine.

Here is the error, i dont know what is this, and dont even now this is error or not.

screen shot 2017-02-02 at 12 37 26 pm

screen shot 2017-02-02 at 12 37 38 pm

Thanks for your help

heuism commented 7 years ago

added a bit of details about the error:

screen shot 2017-02-02 at 2 04 54 pm

Thanks Kevin

KevinCoble commented 7 years ago

I have been unable to get much time to look at this, but have not forgotten it. The string in the error "mach-o, but wrong architecture" might indicate that an intel library is installed, while an ARM one is needed for iOS apps, or vice-versa. Are you sure you got the iOS build embedded, not the macOS one?

KevinCoble commented 7 years ago

Doing a deep-dive into the framework I see that even though it builds for an iPhoneSimulator, it is doing so with x86 architecture, not ARM. I do not know XCode well enough to find a quick solution. I will try to see what I can find. In the meantime, you might want to just copy the source files you need into your project and build (remove the embedded framework) - this is what I had been doing with iOS projects until you spurred me into finding the embed method. I will keep this issue open till I find an embed solution.

heuism commented 7 years ago

Thanks Kevin,

I will try to do that instead, thanks for your help.

Oh, i just remember one thing, don't know if that would help or not! I tried to run using the emulator and this error didn't show up! Using the same emulator similar to mine as iPhone 6splus and iOs 10.2!

Thanks again for your time

KevinCoble commented 7 years ago

OK, I have figured out how to make an ARM version of the framework so it can be run on iOS devices. It required some changes to the code (get the latest version) to deal with default integer sizes.

Select the scheme AIToolboxIOS. The select the Destination for an iOS device - for a generic framework the device "Generic iOS Device" can be used. This will create an ARM version of the framework.

Right-click on the product and select "Show in Finder". Verify that the Modules/AIToolbox.swiftmodule directory contains a arm64.swiftdoc file. This verifies the ARM version was built.

Embed that version and see if you can run on your device.

heuism commented 7 years ago

@KevinCoble thanks mate for the hard work you have done, i will try to see how it works out. It seems the latest version of code solved the 2 issues i post here, i will have a look soon. Btw, as you stated that "Generic iOS device", you think i should pick that if i want to support all iOS devices?

Thanks again :)

KevinCoble commented 7 years ago

Closing this issue (I believe heuism got his example working)