While most of native modules will just work directly, you might run into some issues with some. Here’s a list of some common problems & their easy fixes.
The simple fix for this is to enable multidex in your android app.
App_Resources/Android/app.gradle
multiDexEnabled true
inside `defaultConfig
defaultConfig {
...
multiDexEnabled true
}
This usually happens when a module mixes ESM and CommonJS in a single file. To fix this we need to compile the module with metro-react-native-babel-preset
. First install metro-react-native-babel-preset
.
npm install -D metro-react-native-babel-preset
yarn add -D metro-react-native-babel-preset
Now open webpack.config.js
file & add the following for your module.
This usually happens because your hooks
folder is outdated. The easiest way to fix this is run ns clean
and run your project again so open native hooks are updated.
While Open Native can run most native modules, there might be some exceptions that require a few extra steps. Feel free to open an issue and we will take a look. You can also join NativeScript Discord Community and send a message in #open-native channel for quicker help.