React native project doesn't run iOS - javascript

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

Related

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

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

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

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

React-Native cannot run project if I am not Sudo

I am unable to run react-native project with the code react-native run-android. I am getting the following error
info Starting JS server...
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not create service of type AnnotationProcessorDetector using JavaGradleScopeServices.createAnnotationProcessorDetector().
* 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 1s
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.
But it runs if I run it as root `sudo react-native run-andoid'.
How can I make the project run without being root??
I found out from reading the post by Medium that u have to give permission to every folder explicitly when u encounter a permission issue when installing react native and realated tools, so that u can run the app without being sudo. Otherwise the files installed by sudo can only be run as sudo.
Use the below command to give access to the current user for that specific folder
sudo chown -R $(whoami) ~/Documents/Myapplicationfolder

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