How to Install React- Naitve project after uninstalling it from physical device - javascript

I have recently uninstalled the react native project to rebuild the project in the physical device.
Installing APK 'app-debug.apk' on 'ZenFone Max Pro M1 - 10' for app:debug
Installed on 1 device.
BUILD SUCCESSFUL in 26s
167 actionable tasks: 2 executed, 165 up-to-date
info Connecting to the development server...
info Starting the app on "C4ATAS000000"...
but it would not initialize the project. after showing this error.
Starting: Intent { cmp=com.newproject/.MainActivity }
Error type 3
Error: Activity class {com.newproject/com.newproject.MainActivity} does not exist.
Done in 37.23s.
What should i do to install it again in the physical device.
My Gratefulness in advance

This is a common error that occurs sometimes, Have a try with the below commands which might help you
Uninstall the old app
open project and then open terminal
cd android
./gradlew clean
cd ..
npx react-native run-android

Related

React native project doesn't run iOS

I've started React-Native programing recently. When I want to create a new project based on a guidence of "https://reactnative.dev/docs/environment-setup" and want to run in xcode 12.5 this error is shown:
bash: Progects/Trading: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
enter image description here
I' ll be thankfull of guiding me
Make sure you installed pods. If you already installed then delete the pods folder and podfile.lock inside the ios.
Run this command on your terminal:
cd ios && pod install && cd ..
Open your ios folder through finder and open .xcworkspace file and run from their

React Native, Failed to launch emulator. Reason: No emulators found as an output

I'm trying to run my react native app in emulator by using command react-native run-android but it's throwing that error
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 44s
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync /Opt/Android/platform-tools/adb ENOENT
info Starting the app...
The system cannot find the path specified.
error Failed to start the app. Run CLI with --verbose flag for more details.
Error: Command failed: /Opt/Android/platform-tools/adb shell am start -n com.reactproject/com.reactproject.MainActivity
at makeError (C:\Users\Danger World\ReactProject\node_modules\execa\index.js:174:9)
I already setup my android studio and sdk manager, avd manager like it's shown in doc also I already set path but it's still showing that error, anyone know why? Can anyone help please?
You can fix it by using the command :
react-native doctor
This command shows all issues that need to be fixed.
Press f to fix the issues and don't forget to restart your windows
And after then open the emulator before running your project.
Once emulator opened,
run command:
react-native run-android
After fixed:
Don't forget to give me an upvote if that's work.
In My Case, I have to re-run the command in the same terminal where you are trying to run npx react-native run-android
Step 1. paste the source command first
source ~/.bash_profile OR source ~/.bashrc
Step 2. RUN Next command
npx react-native run-android
set your AVD manager path and JDK path like this , also you have to add Android Home path

React Native, why react-native run-android not working?

I'm trying to run react native run-android after I update my project file, but whenever I run react-native it throws an error. When I created that project and that command it worked fine but when I edit and add some files like apps/redux, apps/components, screens etc it stopped working. Can anyone tell me why it's not working?
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
> Task :app:compileDebugJavaWithJavac
> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.
> Task :app:installDebug FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings
27 actionable tasks: 6 executed, 21 up-to-date
Note: C:\Users\Danger World\ReactProject\android\app\src\debug\java\com\reactproject\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 11s
error Failed to install the app. Make sure you have an Android emulator running or a device connected. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: C:\Users\Danger World\ReactProject\android\app\src\debug\java\com\reactproject\ReactNativeFlipper.java uses or overrides a deprecated API.
you either need to create a virtual device or connect a physical device with USB debuging enabled (https://developer.android.com/studio/debug/dev-options).
To create a virtual device, open android studio and select AVD manager from Configure menu and create a new virtual device downloading required packages.
In case you are using a virtual device with Android studio then try to manually run the emulator BEFORE react-native run-android.
(open android studio > Tools > AVD Manager > Create Virtual Device)
https://developer.android.com/studio/run/managing-avds#createavd
Or repeat the official installation guide:
https://reactnative.dev/docs/environment-setup

build failed react-native 0.6.5 We ran "xcodebuild" command but it exited with error code 65

I'm having this problem "error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening starter.xcodeproj. Run CLI with --verbose flag for more details." since I pulled the latest update from the other colleague, I can't run the project in my simulator, but my colleagues side works fine.
I've tried to change the build system to legacy build system.
Clone the project again.
remove the build folder under iOS folder, and run again.
remove the node module folder and run again.
I have tested in different device is not working too.
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening starter.xcodeproj. Run CLI with --verbose flag for more details.
User defaults from command line:
IDEDerivedDataPathOverride = /Users/nexplatform/Desktop/padini scm mobile/SCM/ios/build/starter
brew install cocoapods
cd projectfolder/ios
pod install
and
cd..
react-native run-ios

Module hmrclient is not registered react native, why is this happening and how to fix it?

So I have rage shaken my tablet and in dev settings, I have my JS dev mode to true yet, live/hot reloading does not work. Funny thing is, when I run the app on a colleague's Mac (the same model and everything) - it works fine.
I don't know what or why this is happening.
I've tried:
cd android && ./gradlew clean
then cd .. && react-native run-android
https://github.com/expo/expo/issues/916
and also:
rm -rf node_modules && npm install
cd android && ./gradlew clean
React-Native Module HMRClinet is not a registered callable module(calling enable)
import com.facebook.react.BuildConfig;
react-native run-android
Unable to load script from assets index.android.bundle on windows
None of the above solutions work.
Do you guys know how I can solve this issue?
This issue come due to development server error.
Follow some steps to resolve this issue.
Step 1:
adb kill-server
adb start-server
then check your device/emulator is visible on command prompt or not.
adb devices
Step 2
Clean your gradle compiler files, some file may be corrupt.
android/gradlew clean
Step 3:
Remove application from your device/emulator.
Step 4:
react-native run-android
Now issue will be resoled :)
React-Native Module HMRClinet is not a registered callable module(calling enable)

Categories