آموزش جاوااسکریپت انجمن ها react native اجرای react-native روی جنی موشن

در حال نمایش 6 نوشته (از کل 6)
  • نویسنده
    نوشته‌ها
  • #54938 پاسخ
    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! enoent

    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_25_16_
    089Z-debug.log

    #54940 پاسخ
    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 of emulator -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=8081

    at 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
    این هم ارور اجرا روی گوشی یا جنی موشنه

    #54939 پاسخ
    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 of emulator -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=8081

    at 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

    #55030 پاسخ

    سلام؟
    داره میگه متغیر JAVA_HOME آدرسی که براش مشخص شده معتبر نیست

    #57669 پاسخ
    رضا
    میهمان

    باسلام
    هنگام اجرای پروژه ری اکت نیتیو خطاهای زیر نشان داده میشه در ضمن جهت شبیه ساز از جنی موشن استفاده میکنم و اندروید استودیو هم نصب است و ویندوز 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.GradleWrapperMain

    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=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.GradleWrapperMain

    at 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.

    #57859 پاسخ

    مطمئن شوید که فرآیند setup
    react native رو به درستی انجام دادید(متغیرهای JAVA_HOME, ….)
    از مسیر زیر gradle رو نصب کنید
    (https://gradle.org/install/)
    پوشه android پروژه خودتون رو باز کنید و دستور زیر رو اجرا کنید
    gradle wrapper

در حال نمایش 6 نوشته (از کل 6)
پاسخ به: پاسخ#54940 در اجرای react-native روی جنی موشن
اطلاعات شما: