NativeScript / NativeScript/nativescript-cli

Consuming static library on iOS doesn't work

Open
#2,811 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug os: ios plugins
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

it seems that after removing the lib/iOS directory we fail to consume plugins containing a static libraries. According to the doc a plugin containing a static library should have the following structure:

my-plugin/
├── ...
└── platforms/
    └── ios/
        ├── MyStaticiOSLibrary.a
        └── include/
            └── MyStaticiOSLibrary/
                └── Header1.h
                └── Header2.h
                └── ...

When processing such a plugin the CLI should add the path to MyStaticiOSLibrary.a binary to the project library search paths but it doesn't happen. As a result the build fails with:

ld: library not found for -lMyStaticiOSLibrary

Environment:

CLI, tns-core-modules, ios-runtime -> 3.0.0

Steps to reproduce:

  1. Create a blank app -> tns create MyApp
  2. Create a plugin with the folder structure described above
  3. Add the plugin to the app -> tns plugin add my-plugin
  4. Run the app: tns run ios

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CLI plugin-processing path exercised by tns plugin add and tns run ios, using the documented platforms/ios layout and the static-library linker error as the reproduction. Trace how MyStaticiOSLibrary.a is handled and verify that its directory reaches the project library search paths; done means the sample app builds and runs with the plugin.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript
Domain
cli, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.