I am creating a React Native module as a wrapper for existing Android and iOS libraries. The Android library is a jar file and the iOS library is xcframework file. I put the xcframework file inside the ios folder, and the jar file inside android/libs folder ( I created the libs folder). I first tried the iOS library by adding s.preserve_path, s.xcconfig and s.vendored_framework inside the project level podspec file. I am not sure if I need to do anything for the pod spec file, like running it. So I just went along with the next step by trying to import the library's .h in .m file. I tried both using angle brackets <> and using quotes "". But none worked, because firing "react-native run-is" gave me this error: fatal error: file not found. Any help on how to include the libraries in react native is greatly appreciated.
How to create react native wrappers for native android and iOS SDKs
2.3k views Asked by Wei Wen At
2
There are 2 answers
1
AudioBubble
On
For creating react native wrapper or node module you need use below library.
https://www.npmjs.com/package/react-native-create-library
https://github.com/brodybits/create-react-native-module
Using this library you can create empty react native module project after that you can bind your native code ARR or framework files into that project.
Related Questions in REACT-NATIVE
- ussd reader in Recket Native module
- I can't make TextInput to auto expand properly in Android
- expo config plugin use import instead of require
- Custom Sound for Expo Push Notifications Only Works in Foreground
- run RTK dispatch on gesture start with React Native
- Should I set Back-End for my React Native application?
- using infoPlist in app.json for expo project seems to not be working
- Anyone have success configuring react-native-home-indicator?
- KeyboardAvoidingView makes a messy the flexbox
- I am getting lots of errors when building react native app in Xcode
- Search and highlight text of current text in PDFKit Swift
- Flatlist Sometimes Capped at 10 Items Bug
- Is there any way to page transition in react native (stack navigation)
- Screen inside Stack.Navigator not visible in React-Native
- React Native stopwatch implementation slow on iOS
Related Questions in ANDROID-LIBRARY
- Gradle publish fails to PUT a different random file to s01.oss.sonatype.org/service/local/staging/deploy/maven2 each time
- ClassNotFound exception when inflating a class
- Android - infinite ruler/slider to change int value
- How do I migrate my Android library's usage of the "maven-publish" and "signing" Gradle plugins from the Groovy DSL to the Kotlin DSL?
- What went wrong: Execution failed for task ':app:publishMavenPublicationToMavenLocal'
- How to decide of whether to switch long-running tasks to another thread in your library or leave it to the user (developer)?
- Publish each Android library flavour to it's own repository
- How to distribute android library which are dependent on each other using Jitpack?
- Unity as a Library - Communication between app module and unityLibrary
- NoClassDefFoundError despite using api for dependency in a library
- kotlinCompilerExtensionVersion in android library
- "Android Library Module (shared-test) Unable to Recognize Third-Party Library from App Module"
- Create android library through maven publish which is having a dependency on AAR file
- Facing issue while integration firebase on Android Library
- How to make functions as protected into library module's classes?
Related Questions in IOS-LIBRARY
- unsupported Swift architecture in Objective-C
- How updating dynamic framework will affect App Store build
- How to create react native wrappers for native android and iOS SDKs
- Building static library with Swift package
- Making UI elements programmatically in iOS using Xcode in Objective-C
- React Native: Unable to import React headers after updating to 0.60
- React-native link does not relink after manually removing the links
- ResearchKit.framework error: Image not found
- How to add custom subclass in cocoa framework
- Is iOS state restoration possible in iOS library? -- Could not find a storyboard named
- API / Library to Integrate Forum within native Mobile Application
- Is it possible to write a C++ library that could be used in iOS and Android Native projects?
- Difference between manually file import and pod installation in Xcode?
- How to import standalone Xcode Project as a module to another project?
- In iOS "Spring" library for animation, Do we need to set "animation" property each time before calling "animate()" method?
Related Questions in REACT-NATIVE-MODULES
- calling kotlin module inside react native app
- getting function imported correctly in android but in ios gettting import value is null in react native module
- Newer Native Module methods not getting exposed to JS
- mediaPlayer.setOnBufferingUpdateListener error does not return anything
- Get play back details
- Create an npm Package for React Native with Swift Libraries
- Trouble writing serial port for React native windows c++ native module
- React Native Error: Module not found (I did't not have any ReactNative experience before)
- react-native module - automatic CFlags
- How to handle NativeModules when writing tests for React Native
- Emit event from other class than native module class from android to react-native
- React native module Linking issue of packages
- How to access ReactContextBaseJavaModule from both, a react native file (*.js) and a Kotlin class (*.kt)?
- new Thread and React Native. Add Mapsforge library
- "_ setUrl: unrecognized selector sent to instance" setting the url property to the Swift Publisher
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I was able to fix the error by doing the following two steps:
Change "s.vendored_framework" to "s.vendored_frameworks" in the project level .podspec file. My original one is singular (framework), not plural (frameworks).
cd iOS && pod install && cd ..
Step 2 can be found in create-react-native-module's GitHub link: https://github.com/brodybits/create-react-native-module
I missed the second step when posting my question. I thought then that if I ran "react-native run-ios", it would run "pod install".