Problem in Ejecting React Native Project (npm run eject issue) in version 0.57

Hey, Guys here is the solution to the problem commonly faced by many of React Native developers nowadays that is the problem in ejecting the React Native Project after the React Native version 0.57 launch.

The problem in ejecting the React Native Project:

The problem happens when we create a project using create-react-native-app and try to eject the project using npm run eject. It shows the error: cannot find symbol

and error: MainActivity is not abstract and does not override abstract method getPackages() in ReactActivity

Solution:

To solve this problem we have you have to make some changes to your project and the changes are as following:

Step 1: 

replace in package.json

to

Step 2:

Make an index.js file in your project directory

Add the following code in index.js

Step 3:

Now remove node module folder and install again using

Step 4:

That is enough to solve the problem now you can run your project again using

If you have any doubt 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. 🙂

You have not accepted the license agreements of the following SDK components

You have not accepted the license agreements of the following SDK components

To solve this problem you just need to accept the terms and conditions of the SDK component. To accept the terms and conditions you can use a command line tool sdkmanager.

The sdkmanager is a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK. If you’re using Android Studio, then you do not need to use this tool and you can instead manage your SDK packages from the IDE.

You can find the sdkmanager tool provided in the Android SDK Tools package (For Android version 25.2.3 or higher).

Solution:

We can solve this problem in 2 simple steps:

1. Go to SDK -> tool -> bin using the following command

2. Run the following command to ask for licenses acceptance

It will show you the terms and condition which you have to accept by simply entering y-> Yes or n-> No

That’s it. Now you can run your project again.

This is how you can solve the problem of “You have not accepted the license agreements of the following SDK components”. I hope you have also solved the problem. If you have any doubt 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. 🙂

Unable To Load Script From Assets index.android.bundle

Hey, Guys here is the solution to the problem commonly faced by many of React Native developers that is “Unable To Load Script From Assets index.android.bundle”.

Problem–> Unable To Load Script From Assets index.android.bundle. Make sure your bundle is packaged correctly or you’re running a packaged server.

This problem happens when we run the application using react-native run-android and it gets successfully installed in the device but either the development server has not started or if started, the installed app is unable to connect to the development server.

We have tried different solutions you can try it with your own.

Solution

Our first and the simple solution of “Unable To Load Script” problem is to check the following point

  1. Check whether your device is online or not?
  2. If you are running the application on the real device then the device should be on the same network where the development server is running.

These 2 simple checks can solve the problem easily.

                 

If you have any doubt 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. 🙂

Problem – After running “npm start” execution got stuck on “starting/running packager..”

Solution to the problem -> After running “npm start” execution got stuck on starting/running packager

When we run npm start it took some time as per your CPU and RAM configuration but in some cases, it took more than an hour which is a problem. If you are fighting with the same here is the solution.

Temporary Solution for the Problem

after running npm start when it shows “starting/running packager.” just press ‘q’ it will display the QR code, but it won’t display the QR code automatically. If you don’t press ‘q’, it will just say “starting/running packager”.

 

Permanent Solution

To solve this issue permanently you need to remove the nodejs and npm completely from your computer. To remove

Windows Users can uninstall npm and node and can download the latest one and install. If you have any issue please follow this post to install node and npm.

Linux Users can uninstall and remove nodejs and npm by running the following command

Then go to /etc/apt/sources.list.d and remove any node list if you have.

After removing all the file run

It will remove your npm and nodejs completely. Also remove the node_module from your package too.

Open the terminal and run the following commands to install nodejs and npm in Linux

Test using following commands

If you have any other concern about node and npm installation please have a look at this.

After Installation of node again delete the node_module directory from your project and run

This will take some time as this will make the node_module directory again by installing the node dependencies.

After that try to run following command again to run the project in Expo Client App.

Hope it will work as it worked for me.

If you have any doubt 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. 🙂

‘react-native’ is not recognized as an internal or external command

The problem of ‘react-native’ is not recognized as an internal or external command

While ejecting your project out of Expo environment you can face this problem. To solve this problem, the solution is simple just install react-native-cli using the following command.

The command will install the react-native-cli on your command line and you can use your react-native command which is located here

C:\Users\Admin\AppData\Roaming\npm\react-native -> C:\Users\Admin\AppData\Roaming\npm\node_modules\react-native-cli\index.js