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

create plugin by static static libraries error #2967

Closed
tsonevn opened this issue Jul 11, 2017 · 5 comments
Closed

create plugin by static static libraries error #2967

tsonevn opened this issue Jul 11, 2017 · 5 comments
Assignees
Milestone

Comments

@tsonevn
Copy link
Contributor

tsonevn commented Jul 11, 2017

From @xiaochong44 on July 4, 2017 6:29

I create new plugin by static libraries;
he have three file. jcore-ios-1.1.5.a jpush-ios-3.0.6.a and JPUSHService.h.
tns run ios show error
Processing node_modules failed. Exception: The static library at /Users/feng/AnBangCrmApp/node_modules/nativescript-jpush/platforms/ios/jcore-ios-1.1.5.a is not built for one or more of the following required arch
itectures: armv7, arm64, i386. The static library must be built for all required architectures.

lipo -info show
Architectures in the fat file: /Users/feng/AnBangCrmApp/node_modules/nativescript-jpush/platforms/ios/jcore-ios-1.1.5.a are: armv7 armv7s x86_64 arm64

Copied from original issue: NativeScript/NativeScript#4501

@tsonevn
Copy link
Contributor Author

tsonevn commented Jul 11, 2017

From @NickIliev on July 4, 2017 12:2

@xiaochong44 the static library you are using is not build for all required architectures and you are trying to build for architecture that is missing (e.g. you are building on real device that requires armv7 but the static library is build only for i386).
What you need is to create a fat static library - see this thread for more information on the topic.

@tsonevn
Copy link
Contributor Author

tsonevn commented Jul 11, 2017

From @xiaochong44 on July 5, 2017 13:25

@NickIliev
Thanks for you message.
This static library is provided by other companies
He is a push service, I386 is before IPhone5 ,The simulator is already x86_64, is there a setting that can not check i386?

@tsonevn
Copy link
Contributor Author

tsonevn commented Jul 11, 2017

From @NickIliev on July 5, 2017 14:1

@xiaochong44 for real devices your static library needs to be built for armv7, arm64,

@tsonevn
Copy link
Contributor Author

tsonevn commented Jul 11, 2017

From @xiaochong44 on July 5, 2017 14:8

@NickIliev
lipo -info
Architectures in the fat file: /Users/feng/AnBangCrmApp/node_modules/nativescript-jpush/platforms/ios/jcore-ios-1.1.5.a are: armv7 armv7s x86_64 arm64
It should have armv7 arm64?

@tsonevn
Copy link
Contributor Author

tsonevn commented Jul 11, 2017

From @ivanbuhov on July 5, 2017 14:47

@xiaochong44 The CLI checks each library against a list of required architectures and fails if the binary doesn't contain even one of them. Currently, the list contains armv7, arm64 and i386 archs. However, it is a perfectly valid scenario to include a library containing only device architectures (armv7, arm64) so IMO the current behaviour is buggy. Ideally, we should check for existence only those archs we are building for. This way, building for release won't fail because of missing simulator architecture. I am reopening the issue and tagging it as bug.

To workaround the problem you can merge your existing jcore-ios-1.1.5.a binary with an empty i386 library. Open Xcode and create an empty static library target and run a build for i386 arch. The produced binary can be merged with the existing library:

lipo -create jcore-ios-1.1.5.a my_dummy_i386_lib.a -output  jcore-ios-1.1.5-fat.a

This way, the library still won't work on simulators because the i386 slice doesn't contain any symbols but it is enough to make the CLI check pass.

@dtopuzov dtopuzov added bug and removed 1 - Backlog labels Jul 11, 2017
@pkoleva pkoleva added this to the 3.2.0 milestone Jul 13, 2017
mbektchiev added a commit that referenced this issue Oct 19, 2017
It tries to predict a linker error and stop earlier, but there are cases where it fails to do so correctly.
We now start building without any preliminary checks on libraries and let it fail with whatever error it does.

fixes #2967
@mbektchiev mbektchiev modified the milestones: 3.2.0, 3.3.0 Oct 19, 2017
@mbektchiev mbektchiev self-assigned this Oct 19, 2017
Mitko-Kerezov pushed a commit that referenced this issue Oct 23, 2017
It tries to predict a linker error and stop earlier, but there are cases where it fails to do so correctly.
We now start building without any preliminary checks on libraries and let it fail with whatever error it does.

fixes #2967
rosen-vladimirov pushed a commit that referenced this issue Nov 15, 2017
It tries to predict a linker error and stop earlier, but there are cases where it fails to do so correctly.
We now start building without any preliminary checks on libraries and let it fail with whatever error it does.

fixes #2967
rosen-vladimirov added a commit that referenced this issue Nov 15, 2017
* Remove iOS static library verification (#3169)

It tries to predict a linker error and stop earlier, but there are cases where it fails to do so correctly.
We now start building without any preliminary checks on libraries and let it fail with whatever error it does.

fixes #2967

* Update Changelog for 3.3.1 release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants