0

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 Chatwithpdf

Here is the repository: Chatwithpdf GitHub Repo

Now, I want to add additional functionality, such as login/signup using Appwrite . Here is my login implementation: 👉 appwrite.ts

However, when I try to run the app, I get the following error:

TypeError: Cannot read property 'NativeModule' of undefined

It seems like I’m missing some configuration related to native modules.

Steps to reproduce:

Clone the repo.

Install dependencies:

npm install --legacy-peer-deps

Start Metro:

npm start

Run the Android app:

npm run android

Question: What configuration or setup am I missing to properly use Android native modules in my React Native project?

enter image description here

4
  • Share error screenshot. Commented Aug 26 at 9:22
  • have you checked stackoverflow.com/questions/78452140/… Commented Aug 26 at 9:28
  • @JatinBhuva, I updated the question with ss Commented Aug 26 at 17:33
  • I think I’ve found the issue: some of the libraries are not compatible with Android native modules. We’ll need to find suitable alternatives. I debugged the problem by commenting out the code line by line, and identified that certain libraries need to be replaced. Commented Aug 28 at 4:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.