آموزش جاوااسکریپت › انجمن ها › react native › اجرای react-native روی جنی موشن
- این موضوع 5 پاسخ، 2 کاربر را دارد و آخرین بار در 2 سال پیش بدست مهدی حسن زاده بهروزرسانی شده است.
-
نویسندهنوشتهها
-
zamany1370مشارکت کننده
سلام
من برنامه ری اکت نیتیو را بر روی جنی موشن میخواهم اجرا کنم از دستور npm run android استفاده میکنم ولی برنامه من را روی جنی موشن اجرا نمی کند و ارور زیر را میدهد
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\program\Android studeo\Android SDK Full\Android SDK Full\platfo
rm-tools\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open ‘D:\program\Android stud
eo\Android SDK Full\Android SDK Full\platform-tools\package.json’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoentnpm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sayan\AppData\Roaming\npm-cache\_logs\2021-04-12T18_25_16_
089Z-debug.logzamany1370مشارکت کنندهinfo Running jetifier to migrate libraries to AndroidX. You can disable it using “–no-jetifier” flag.
Jetifier found 903 file(s) to forward-jetify. Using 8 workers…
info Starting JS server…
‘adb’ is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator…
error Failed to launch emulator. Reason: No emulators found as an output ofemulator -list-avds
.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app…ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files (x86)\Java\jdk1.6.0_45
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081at makeError (D:\dev\project\SellMe\node_modules\execa\index.js:174:9)
at D:\dev\project\SellMe\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (D:\dev\project\SellMe\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (D:\dev\project\SellMe\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with –verbose flag for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! SellMe@0.0.1 android:react-native run-android
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the SellMe@0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sayan\AppData\Roaming\npm-cache\_logs\2021-04-12T18_38_21_958Z-debug.log
این هم ارور اجرا روی گوشی یا جنی موشنهzamany1370مشارکت کنندهدر ضمن برای اچرای روی گوشی یا جنی موشن هم ارور زیر را میدهد
info Running jetifier to migrate libraries to AndroidX. You can disable it using “–no-jetifier” flag.
Jetifier found 903 file(s) to forward-jetify. Using 8 workers…
info Starting JS server…
‘adb’ is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator…
error Failed to launch emulator. Reason: No emulators found as an output ofemulator -list-avds
.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app…ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files (x86)\Java\jdk1.6.0_45
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081at makeError (D:\dev\project\SellMe\node_modules\execa\index.js:174:9)
at D:\dev\project\SellMe\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (D:\dev\project\SellMe\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (D:\dev\project\SellMe\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with –verbose flag for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! SellMe@0.0.1 android:react-native run-android
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the SellMe@0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sayan\AppData\Roaming\npm-cache\_logs\2021-04-12T18_38_21_958Z-debug.logمهدی حسن زادهمدیرکلسلام؟
داره میگه متغیر JAVA_HOME آدرسی که براش مشخص شده معتبر نیسترضامیهمانباسلام
هنگام اجرای پروژه ری اکت نیتیو خطاهای زیر نشان داده میشه در ضمن جهت شبیه ساز از جنی موشن استفاده میکنم و اندروید استودیو هم نصب است و ویندوز 10 است. در ضمن شبیه ساز جنیموشن را هم از داخل اندروید استودیو اجرا میکنم و با موفقیت هماجرا میشه ولی هنگام اجرای پروژه ری اکت خطای اجرا نبودن شبیه ساز را میده لطفا راهنمایی بفرمایید.باتشکر
PS C:\Users\R&T\Desktop\project\reactnative\secondpo> react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using “–no-jetifier” flag.
Jetifier found 896 file(s) to forward-jetify. Using 4 workers…
info Starting JS server…
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
info Launching emulator…
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
‘C:\Users\R’ is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app…
‘T\Desktop\project\reactnative\secondpo\android\’ is not recognized as an internal or external command,
operable program or batch file.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMainerror Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
‘T\Desktop\project\reactnative\secondpo\android\’ is not recognized as an internal or external command,
operable program or batch file.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMainat makeError (C:\Users\R&T\Desktop\project\reactnative\secondpo\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\R&T\Desktop\project\reactnative\secondpo\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\R&T\Desktop\project\reactnative\secondpo\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\R&T\AppData\Roaming\npm\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with –verbose flag for more details.مهدی حسن زادهمدیرکلمطمئن شوید که فرآیند setup
react native رو به درستی انجام دادید(متغیرهای JAVA_HOME, ….)
از مسیر زیر gradle رو نصب کنید
(https://gradle.org/install/)
پوشه android پروژه خودتون رو باز کنید و دستور زیر رو اجرا کنید
gradle wrapper -
نویسندهنوشتهها