آموزش جاوااسکریپت › انجمن ها › react native › اجرا نشدن react-native run-android
- این موضوع 22 پاسخ، 10 کاربر را دارد و آخرین بار در 4 سال، 1 ماه پیش بدست مهدی حسن زاده بهروزرسانی شده است.
-
نویسندهنوشتهها
-
mobinslyمشارکت کننده
سلام
خسته نباشید برای من هم یه همچین اروری میده و اصلا اجرا نمی کنه
اولین بارمم هست که می خوام اجراش کنم،البته ارورش یکم فرق داره:D:\React Native\project\test2>react-native run-android
Starting JS server…
Building and installing the app on the device (cd android && gradlew.bat installDebug)…
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use –status for detailsFAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().* 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 25s
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.htmlCommand failed: gradlew.bat installDebug
Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at runOnAllDevices (D:\React Native\project\test2\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (D:\React Native\project\test2\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (D:\React Native\project\test2\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)مهدیمیهمانسلام.از نسخه 8 جاوا استفاده کنید و مطمئن بشید که متغیر JAVA_HOME رو درست تنظیم کردید.
mobinslyمشارکت کنندهببخشد ولی متاسفانه کار نکرد 🙁
از “شکن” هم استفاده کردم ولی جواب نداد و متن زیر رو داد:JavaScript1234567891011121314151617181920212223242526272829303132333435363738394041424344Starting JS server...Building and installing the app on the device (cd android && gradlew.bat installDebug)...> Configure project :appWARNING: The specified Android SDK Build Tools version (28.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.2.1.Android SDK Build Tools 28.0.3 will be used.To suppress this warning, remove "buildToolsVersion '28.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.Checking the license for package Android SDK Build-Tools 28.0.3 in G:\SDK Andriod\SDK\Android SDK Tools v26.1.1 Full Bundle\sdk\licensesWarning: License for package Android SDK Build-Tools 28.0.3 not accepted.Checking the license for package Android SDK Platform 28 in G:\SDK Andriod\SDK\Android SDK Tools v26.1.1 Full Bundle\sdk\licensesWarning: License for package Android SDK Platform 28 not accepted.FAILURE: Build failed with an exception.* What went wrong:A problem occurred configuring project ':app'.> Failed to install the following Android SDK packages as some licences have not been accepted.build-tools;28.0.3 Android SDK Build-Tools 28.0.3platforms;android-28 Android SDK Platform 28To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.htmlUsing Android SDK: G:\SDK Andriod\SDK\Android SDK Tools v26.1.1 Full Bundle\sdk* 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.orgBUILD FAILED in 8sCould 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 haveset up your Android development environment:https://facebook.github.io/react-native/docs/getting-started.htmlCommand failed: gradlew.bat installDebugError: Command failed: gradlew.bat installDebugat checkExecSyncError (child_process.js:616:11)at Object.execFileSync (child_process.js:634:13)at runOnAllDevices (D:\React Native\project\test2\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)at buildAndRun (D:\React Native\project\test2\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)at isPackagerRunning.then.result (D:\React Native\project\test2\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)at process._tickCallback (internal/process/next_tick.js:68:7)sa_hmaمشارکت کنندهسلام
ممنون میشم لینک برای دانلود jdk نسخه 8 رو بزارید.مهدیمیهمانسلام.
در صفحه ملزومات برنامه نویسی react native کلیه موارد مورد نیاز لینک دانلودش به صورت مستقیم قرار گرفته
https://reactapp.ir/essentials-programming-react-native/arashمشارکت کنندهسلام
من هم شبیه این مشکل رو داشتم که مدت های زیادی بود که نمیتونستم برطرفش کنم. شما بهتره از فیلتر شکنه شکن استفاده کنید و برای کلاینتتون DNS سرور تعریف کنید. همچنین این مشکل مربوط به عدم آپدیت فایل gradle است که در پیغام خطا نیز مشاهده می شود. و شما باید android sdk رو آپدیت کنید و هنگام اجرای دستور react-native run-android حتما باید DNS سرور ست شده باشه . که هنگام اجرا شروع میکنه به آپدیت و مشکل برطرف میشهhrahimiمشارکت کنندهسلام
من همه امکانات لازم رو از سایت خودتون دانلود و نصب کردم دو مشکل دارم :
1- AVD Manager جداگانه از پوشه sdk اجرا نمیشه. فقط از طریق اندروید استودیو اجرا میشه.
2- موقع run کردن پروژه با استفاده از دستور react-native run-android توی cmd ، شبیه ساز اجرا نمیشه و فقط مطابق شکل زیر شروع میکنه Gradle رو دانلود کردن. در صورتیکه بروز هست و انرو بصورت دستی هم گرفتم و نصب کردمhttp://uupload.ir/files/2byb_rn.jpg
لطفا راهنمایی بفرمائید . خیلی نیاز دارم و کلی عقب افتادم.
ممنونممهدی حسن زادهمدیرکلمنتظر بمونید تا دانلود کنه.نهایتا 10 دقیقه طول میکشه
-
نویسندهنوشتهها