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

Inaccessible native source code without modulemap #5187

Closed
mbektchiev opened this issue Dec 18, 2019 · 1 comment
Closed

Inaccessible native source code without modulemap #5187

mbektchiev opened this issue Dec 18, 2019 · 1 comment
Assignees
Labels
needs better error msg os: ios prepare Describes issues related to prepare command
Milestone

Comments

@mbektchiev
Copy link
Contributor

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.3.0

Describe the bug
A user reported the following bug:

When building for iOS, we are trying to invoke a class named MiSnapSDKViewController, which inherits from UIViewController.

This class is defined in /src/platforms/ios/src/MiSnapSDKViewController.m

We are able to build, without error (as long as we do not attempt to access this class), as well as able to generate typings without error.

TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/typings" tns build ios
all of the frameworks are found in the /typings but NOTHING from the /src/platforms/ios/src/ folder.
Also, the class does not appear accessible at run time. But adding the same files to the /demo/App_Resources produces an Xcode error of duplicate classes.

How do we make the MiSnapSDKViewController accessible from Nativescript?

It turned out that they didn't have a module.modulemap file which is necessary for the native code to be picked up by metadata generator and to become callable from JavaScript.

CLI should detect such cases and raise a warning in order to make discovering them much easier and earlier.

@dtopuzov
Copy link
Contributor

Will be shipped with nativescript@6.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs better error msg os: ios prepare Describes issues related to prepare command
Projects
None yet
Development

No branches or pull requests

2 participants