3.23.2022

React Native - Errors. ( Default problems )

When Standard Programming happens ... at the beginning or our daily lives

React Native Errors -  Attention 

1. Error: Activity class {com.appname/com.appname.MainActivity} does not exist.

Despite the message, this is in fact NOT AN ERROR.

As long as you got the successful green message “BUILD SUCCESSFUL” 

(see image below), you can manually open the app on the device/emulator on which you built the project. Just find the app icon and tap on it. That will open the app.










2. Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

If you’re running into this issue, it’s because you’re missing this file: android/gradle/wrapper/gradle-wrapper.jar .

You can generate this binary by simply running

  1. gradle wrapper

in the project’s android folder. If you don’t have gradle installed, follow gradle documentation on how to install it (or just run “brew install gradle” on MacOS).



3. Attention : No bundle URL present

If you’re getting this error, it means your packager server didn’t start. 

You’ll have to start it manually by running

  1. npm start -- --reset-cache


Once the metro bundler started, simply reload the project.


4. SDK Location not found

If you’re running into this issue when building a React Native mobile app on Android, it’s because your Android SDK path is broken or it doesn’t exist. Open your ~/.bash_profile, and add the following lines at the beginning:

  1. export ANDROID_HOME=~/Library/Android/sdk/
  2. export PATH=~/Library/Android/sdk/tools:$PATH
  3. export PATH=~/Library/Android/sdk/platform-tools:$PATH

 

 

Now load the new ~/.bash_profile in your Terminal (restart the Terminal or run “source ~/.bash_profile“), and re-run the Android app.






No comments:

Node.js?

  Node.js? It is JS or Javascript yes, it is the basis.  Yes the old Javascript that today has a strong front and back end stack, the same s...