What is the right way to import custom react native module on Xcode? - react-native

I'm building a custom RN module for iOS and Android. Following some others modules, I notice that the dependencies it's never imported to the module itself, but always imported in the main app. For example for iOS:
react-native-admob has Google Mobile Ads SDK as dependency, but the developer has to add on the app.
That said, I have my custom module only building on Xcode, because when I try to run react-native run-ios I get the error:
info In file included from /Users/.../node_modules/react-native-my-module/ios/MyModuleViewManager.m:2:
/Users/.../node_modules/react-native-my-module/ios/RNMyModule.h:8:9: fatal error: module 'PrebidMobile' not found
#import PrebidMobile;
~~~~~~~^~~~~~~~~~~~
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening myapp.xcworkspace
What could I be doing wrong, that react-native command can't find the import library from Link Binary With Libraries?

Related

react-native android, unable to find a local module

I am building a library and trying to create an example project and test the library.
So in package.json I added "react-native-memoizing": "file:..".
In ts files, I could import and use the library without any issue, but when I run react-native run-android I am getting the error that it cannot resolve the library.
Is there a way I could fix this.

React Native IOS, library linking is not working

I am working on react native application, I have updated react native version of my app. After installing packages and updating pods, I run command to link all libraries::
react-native link
But it doesn't work then I have tried manual linking, now there is no library file inside target -> Build Phases -> Link Binary With Libraries
If I am trying to add ".a" file it gives me an error.
I am quite surprised, my project still running properly on the simulator without linking to libraries.
You can check this image, I am using react-native-navigation. It's running properly without linking.
After adding the library I am getting "Dependency Analysis Error"
Unable to run command 'Libtool libReactNativeNavigation.a' - this
target might include its own product.
Now my project is running properly but there is no library inside "Link Binary With Libraries" section.
The environment I am using as follows::
react-native : 0.59.9
xCode: 10.1
react: 16.8.6
Please suggest to me what I am doing wrong here. Or is this right methodology?

RNTester : Unable to find React Native files

I was going through a react-native tutorial and got a suggestion to check RNTester
I followed the steps of cloning and installing mentioned on github. But when I hit the run button on Xcode I get following error:
error Unable to find React Native files. Make sure "react-native"
module is installed in your project dependencies. Process terminated.
Press to close the window
The simulator is also launched with bunch of method names.
Any help is appreciated.

Native Module cannot be null - when integrating react-native project inside another react-native project

I have a react-native cross platform project based on Underdark library for exchanging data using Bluetooth and Wifi. this is working as react-native project. I am able to transfer data between iPhone and android.
Now i want to integrate this into another react native project as a package or use it in another project. But the private Underdark react native project is not a proper package in itself. It is just a working react native project.
I have integrated by using the following commands.
npm install —save
In Xcode I have imported the project and added the libraries/framework (underdark and protocol buffers ) into Build phases.
On the react side the entire project gets installed under node-modules.
Now i create a component and import the files in underdark library in node modules.
I run the react-native run-ios command to run it on my device.
It builds successfully but gives the following error.
2017-06-29 12:31:27.406 [error][tid:com.facebook.react.JavaScript] Native module cannot be null.
2017-06-29 12:31:27.523 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
My question is
Is it possible to use a react native project in another project as a third party library. even if it is not a package.
How to remove this error.

Unable to use android facebook sdk with android project in IntelliJ

Intellij seems to be detecting the sources fine, no errors in editor, but errors when I remove facebook sDK from project.
I added the facebook-android-sdk module as a module dependency to my project, but when running it, it gives 8 facebook sdk related errors:
package com.facebook.android.Facebook does not exist cannot find
symbol class FacebookError
Any idea how I can fix it?
Just import */gen and include it part of the module and it'll be all fine. Don't just import src/