null is not an object (Evaluating ‘NativeModules[“SQLite”][method]’)

The problem “null is not an object (Evaluating ‘NativeModules[“SQLite”][method]’)” is related to SQLite database. When I made the tutorial Example of SQLite Database in React Native everything was well but after some time when React Native version was updated, I faced this issue.

Problem:

While working with SQLite in React Native you can face the problem “null is not an object (Evaluating ‘NativeModules[“SQLite”][method]’)”.

Solution:

While getting this error I tried to solve it by finding it on the internet but nothing was working. So I followed the following steps and it is solved now.

  1. If you are linking SQLite with react-native link then required changes are not done by the linker so you have to do it on your own. Add the required changes mentioned in the Example of SQLite Database in React Native.
  2. If everything is well and you have already done all the changes then open the following path
    YouSQLiteProject/node_modules/react-native-sqlite-storage/src/android/build.gradle
    and replace

    with

As I was using the react-native:0.58.4 and the defined version was react-native:0.14.+, so just removed the version and added plus(+) for the latest version available and it worked for me. I have also updated compile with implementation because of Gradle 3.+ that Google announced at IO17. If you have no idea about the compile to implementation update then you can visit here, You will find the detailed answer to your question.

Please have a look blow for updated YouSQLiteProject/node_modules/react-native-sqlite-storage/src/android/build.gradle file.

Hope you have also solved your problem. If you have any issue or you want to share something about the topic you can comment below or contact us here. There will be more posts coming soon. Stay tuned!

Hope you liked it. 🙂

Could not Compile Settings File project/android/settings.gradle

While building and installing the app you can face a compilation app that is  Could not Compile Settings File in project/android/settings.gradle. This problem often comes when you link a project dependency in the windows machine and try to run it on Emulator/Device (especially after linking react-native-gesture-handler).

Problem:

After linking any dependency when we build the project:

Build failed with an exception Could not Compile Settings File ‘project/android/settings.gradle’.

Solution:

To solve this problem you need to open the project/android/settings.gradle file and have to replace the backslash(\) with the frontslash(/) as windows directory structure do not support the backslash(\).

Before Changes:

After Changes:

This is how you can solve the problem “Could not Compile Settings File project/android/settings.gradle”. If you have any doubt or you want to share something about the topic you can comment below or contact us here.

Hope you liked it. 🙂

adb server version mismatch react-native run-android

Here is the solution to the problem commonly faced by many of React Native developers that is “adb server version mismatch react-native run-android”.

Problem–> adb server version doesn’t match this client; Killing…

The main reason for adb server version mismatch react-native run-android problem is the mismatch of your adb version.

You can see the problem here

Open the terminal and run

Now jump into the SDK >> platform-tools and run 

You can find the difference there.

Solution

Solution to this problem is very simple. Just copy SDK/platform-tools/adb to /usr/bin using the following command.

Now run your project again. Hope it will work fine.

If you are still facing the issue with this please mention the problem in the comment below. Thanks for reading. Hope you like it 🙂