142 questions
0
votes
0
answers
107
views
Error using Android native module in React Native app: TypeError: Cannot read property 'NativeModule' of undefined
I am trying to use an Android native module in my React Native app, but I’m running into an error.
I created a new project using the React Native CLI:
npx @react-native-community/cli@latest init ...
0
votes
1
answer
333
views
Turbo Native Modules - TEST - Jest - Invariant Violation: TurboModuleRegistry.getEnforcing(...)
This is my spec folder, on Android everything is ok too, everything works normally. Then I use NativeModule normally on a page, but Jest keeps failing.
import type { TurboModule } from "react-...
0
votes
1
answer
118
views
"No type or protocol named 'RCTModuleProvider'"
I am following this documentation to implement a C++ TurboModule:
https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules
I had no problem with android, but on iOS, using XCode, i get an ...
0
votes
0
answers
17
views
init method of Obj C Native Module called twice during app launch in React Native New Architecture
I have followed this walkthrough for integrating a native Module with my react native app (v 0.79) in iOS. When launching the app, the init method of my native module is getting called twice, once ...
0
votes
0
answers
37
views
Can we create ReactNative TurboModules without running CodeGen schema generator?
For my project I have the ReactNative project and Android project created separately. We create a bundle from RN project and save it at the required location in Android project for creating the build.
...
0
votes
1
answer
56
views
Need to Detect Volume Btns when the screen is off
I am working on an application that send command to my python server on my laptop when volume btns pressed like this
const volumeUpSubscription = eventEmitter.addListener(
"onVolumeUp",...
0
votes
0
answers
10
views
React Native Media Element(to load video) is showing blank in native ads in react native
I am implementing native ads in React native. I am loading ads via Native module method therefore I wrote my code in android and return the view to react native layer. The ads are loading fine at ...
0
votes
1
answer
71
views
What to run some functions in the background in React Native (To Avoid blocking the main thread)
In my react-native app, I need to process 12sets of data 20 times every second. It has resulted the application to work slow on older mobile phones. I can't understand how to run this function ...
0
votes
0
answers
25
views
Klarna SignIn(iOS) event handler doesn't intercept events
I'm trying to implement a native module for Klarna signin for iOs in my expo app.
I have already implemented 'klarnaSignIn' function which opens Klarna signin view. I press submit after filling some ...
1
vote
2
answers
1k
views
yarn install in gitlab ci runner creates error "The lockfile would have been modified by this install, which is explicitly forbidden."
I am working on
react-native 0.75.2
yarn 3.6.4
node 20
In my project, I have a native module dependency, which is located inside my project folder. My package.json looks like
"dependencies":...
0
votes
1
answer
115
views
React native Expo bottom navigation (controls)
Is there a way i can remove this black bottom controls on Android?
Can i control immersive mode or full Screen mode with only react-native or expo?
I want to either remove it or at least not see black ...
0
votes
1
answer
318
views
SwiftUI View using HostingController does not correctly Clip to Bounds in ExpoView
The SwiftUI View seems to be cropped off on top in an ExpoView (see Image). Instead I want it to clip to the bounds. Can somebody reproduce or tell me how I can resolve the issue?
I used following ...
1
vote
1
answer
439
views
How to import an asset in swift using Bundle.main.path() in a react-native native module
I'm making an alarm native module (and library) and I need to import an mp3 for the sound of the alarm notification.
I'm trying to import the mp3 using swift with the following code:
guard let ...
1
vote
2
answers
318
views
React Native Module - Unable to Retrieve Phone Number
I have implemented a React Native module (PhoneNumberHintModule) to retrieve phone numbers using the Smart Lock for Passwords API. The native module appears to be correctly implemented, and I have ...
0
votes
1
answer
319
views
Modal transparent prop set to true crashes my app on iOS whenever the Stack.Navigator changes of screen in React Native
I've found this problem in Expo in which whenever Stack.Navigator (@react-navigation/native-stack) changes the screen, from one that contains a Modal with transparent property set to true, the app ...
2
votes
2
answers
3k
views
How to create React Native Module in pure Swift
I have a project on React Native that has a bunch of Native Modules and UI Components. The code is mostly written on Swift but it also has Objective-C code for exporting my swift's native classes and ...
1
vote
1
answer
505
views
how to call a method in startActivityForResult in android using kotlin?
I'm writing a native module in order to adding a generic pass to google wallet in React Native using kotlin. according to google wallet api documentation for android (https://developers.google.com/...
1
vote
0
answers
174
views
Is there a react native package for adding generic passes to google wallet?
I am searching for a react native package which add generic passes into google wallet. There are some old packages that handle .pkpass files. But it's not what i'm looking for. Could anyone help me on ...
1
vote
0
answers
309
views
How to make a new ReactRootView within an Expo native module?
I'm new to react-native and right now I'm trying to make a new react-native app using the Expo framework. As part of my app, I want to show a bar that displays over the screen even when my app is not ...
0
votes
1
answer
246
views
Resize RCTView and reflow the parent view layout
I'm working on a react native wrapper to a 3rd party library.
I need to display a view that will display an image that is loaded via the third party library.
So i first add a subclass of RCTView in ...
7
votes
0
answers
1k
views
Using expo-modules with 3rd party local xcframework (iOS)
I'm trying to build a react-native wrapper module for the official Spotify SDK, using expo-modules. I've added the SDK in my .podspec file using s.vendored_frameworks. Example app's project pre-build ...
3
votes
0
answers
660
views
How to insert a third-party package into an Expo Native Module
I'm starting to build a native library for Expo Native Modules that integrates with an SDK which integrates with a Smart credit card payment terminal, and this SDK exposes various functions to ...
1
vote
0
answers
181
views
Is there a method for evaluating JS in Hermes directly from native code?
I'd like to implement some cross-platform functionality in JavaScript with one gotcha: it needs to be called from native code and synchronously. My understanding is that the JavaScript bridge only ...
4
votes
0
answers
1k
views
Creating a TurboModule in the app causes it to be undefined in react native's new architecture
I am trying to create a TurboModule for my app. I don't want to create it as a separate module as mentioned over here. I want it to be part of my app So I created a RTNCalculator folder inside that a ...
0
votes
0
answers
438
views
Unable to import native (Swift) iOS view into React Native project - requireNativeComponent was not found in the UIManager
Preface: this error message with requireNativeComponent appears often on StackOverflow, mostly resolved with the suggestions such as disintegrating the pods, and then performing a new pod install and ...
1
vote
1
answer
613
views
How to access ReactContextBaseJavaModule from both, a react native file (*.js) and a Kotlin class (*.kt)?
I am new to React Native and working on an application which stores local data using Android SharedPreferences. I currently have SharedPreferences setup as ReactContextBaseJavaModule and am able to ...
0
votes
1
answer
660
views
React Native Error: java.lang.IllegalArgumentException: Could not convert class dev.thanhad.audioplayers.PlayerMode
I'm creating native module for my project. I use npx create-react-native-library, type of library is Native Module and languages is Kotlin & Objective-C.
I add an enum class, add it to ...
0
votes
1
answer
149
views
AVCaptureDevice isTorchActive does not work for React Native
I've tried to write my own module to detect is torch turned on/off.
According to documentation I've tried to run KVC as below
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object ...
0
votes
0
answers
711
views
Objects passed to React Native via native module callback parameters in Swift are null
I am successfully calling a JavaScript callback in a Swift native module in React Native. I need to pass data from the Native side back to React Native, but when the data is anything other than ...
0
votes
1
answer
764
views
Is anybody pass Uint8Array to native module in React Native. I haveError Malformed calls from JS
I try to pass ByteArray to Java Wrapper of my native module, but get error:
Error: Exception in HostFunction: Malformed calls from JS: field sizes are different.
[[20,20,20,20,20,20,20,20,20,20,4,36],[...
0
votes
1
answer
480
views
React Native: save a value send to a Native Module on AppDelegate
I'm building a Native Module in Swift for a RN app where I "remove" the RN view and load a Storyboard, everything works fine but I need to send a value from RN to this Module but it is not ...
5
votes
5
answers
29k
views
React Native: "Cannot find native module" error
In my React Native app, I'm trying to add the expo-mail-composer package using this guide.
I use [email protected],
I added "install-expo-modules": "^0.2.8",
then "expo-mail-...
2
votes
0
answers
341
views
How to send data to JavaScript in events listening from Java using Native Modules?
I'm developing a React Native application with Expo Bare Workflow, in which the app is being applied to an android credit card machine.
When making a payment, it is possible to hear the events that ...
4
votes
1
answer
3k
views
AudioManager setCommunicationDevice is not working on Android 12
I'm developing a mini native (Java) SDK to turn ON/OFF speaker for a react-native app for calls , because React-Native Incall Manager doesn't work properly on Android 12.
Module is working good on ...
0
votes
1
answer
940
views
How to call a Link a Native Android Module Library in React Native
I've been tring to use an Android Library Module but my React Native project fails building whenever I add it as a dependancy :
build.gradle
dependencies {
. . .
implementation project(path: ':...
1
vote
0
answers
277
views
Method addObserver must be called on the main thread Kotlin
When I create a native module on Android using Kotline getting error Method addObserver must be called on the main thread
enter image description here
1
vote
1
answer
7k
views
Installing Notifee with Expo: Error: Notifee native module not found
I'm trying to install Notifee with Expo by using the steps on the installation page: expo install @notifee/react-native and followed by adding "@notifee/react-native" to my plugins in my app....
0
votes
1
answer
214
views
Native Modules Bridges React Native
I have an issue when i try to bridge an Native Modules.
I have a function in Java , the function will calculate the progress when i write a byte , i have a while loop at there.
The problem is whenever ...
1
vote
1
answer
495
views
React Native - IOS ScreenRecordingListener Native Module error: Bridge is not set
I've created a module for listening when a screen record event is trigered but I keep getting this error: Bridge is not set. This is probably because you've explicitly synthesized the bridge in ...
1
vote
0
answers
109
views
How does having an async bridge architecture imply that we have to load all native modules up front?
I am trying to understand the fundamentals of how exactly does the new React Native architecture enables lazy loading. It's extensively documented that-
The new architecture enables what's called ...
3
votes
1
answer
3k
views
React Native - NativeEventEmitter - JSModule not listen to events
Im want to create a RN package (will publish on npm soon) that has a native side. Because of that i thought could be a good idea to put it in my node_modules dir, so i can test while develop, only ...
1
vote
0
answers
224
views
Expo - React Native Firebase - Native module cannot be null
I installed @react-native-firebase/auth and I get all the time these errors
Invariant Violation: Native module cannot be null.
... 9 more stack frames from framework internals
Invariant Violation: &...
1
vote
0
answers
622
views
A WebView method was called on thread 'mqt_native_modules'. All WebView methods must be called on the same thread
I am getting the following error:
Fatal Exception: java.lang.RuntimeException
java.lang.Throwable: A WebView method was called on thread 'mqt_native_modules'. All WebView methods must be called on the ...
0
votes
1
answer
3k
views
Using start activity for result in React Native module
I have native module in my React application, I want to navigate the user to the settings
@ReactMethod
public void manageStoragePermission() {
if (Build.VERSION.SDK_INT >= 30) {
...
1
vote
0
answers
211
views
How to get back data from activity to React-native which is called by intent
I want to get data back from a activity which i called from react native module
@ReactMethod
public void callNewActivity(String code, Callback runner){
Activity activity = getCurrentActivity();
...
1
vote
1
answer
2k
views
How to display logs from Android's native modules to react native's metro
I use the command npx react-native start to run the Metro of react native,
I just use console.log() on my javascript files to log the data to that metro
The problem is when I'm trying to log from my ...
2
votes
1
answer
3k
views
React Native Android Bridge Error: Method addObserver must be called on the main thread
I am using Wootrick SDK for create a bridge to react native. When I'm calling a specific function I'm getting following log and Wootric Survey doesn't show.
java.lang.IllegalStateException: Method ...
3
votes
0
answers
2k
views
EAS Expo Build issue with Installing Dependencies?
I am trying to use EAS in my managed expo app but running into this issue at the build cmd(eas build).
My app works perfectly fine when doing expo start.
This is the error log I get from eas build. ...
2
votes
0
answers
352
views
How to add an extra module for bridge on iOS?
I have created a new native module in my React Native application (It's called RCTAVAudioSessionModule).
When looking in the AppDelegate I found this code snippet:
- (NSArray<id<RCTBridgeModule&...
0
votes
0
answers
753
views
Can I access data stored in React Native's async storage from native modules of ios
Generally we created custom keyboard like https://developer.apple.com/documentation/uikit/keyboards_and_input/creating_a_custom_keyboard and we need to store data in async storage and fetch also. its ...