• 1398/06/04

مشکل react-native run-android :

سلام استاد وقت بخیر

مشکلی که بهش برخوردم مشکل ران کردن پروژس

همه مراحل رو مثل آموزش پیش رفتم ولی در دستور آخر که پروژه رو میخام ران کنم ارور میده

توی خود آموزش هم به این ارور خوردید و گفتید که vpn استفاده کنید اوکی میشه

ولی برای من با vpn هم حل نشد

dns هم از سایت شکن ست کردم باز جواب نداد

راه حل چیه؟؟

  • 1398/06/05
  • ساعت 15:46

سلام دوست من

وی پی ان PPTP باید باشه نه دیگر ضد تحریم ها 


  • 1398/06/05
  • ساعت 21:04

استاد درست نشد باز فایلهایی که میخاد دانلود کنه رو پیدا میکنه میزنه 855 فایل ولی بعد از چند ثانیه به ارور میخوره

این فایلها بصورت جدا جایی نیست بشه دانلود کرد و بصورت دستی اضافشون کنم به پروژه؟؟

همین اول کاری به مشکل خوردم لطفا کمکم کنید


  • 1398/06/05
  • ساعت 23:05

متن خطا رو قرار بدید تا ببینیم مشکل از کجاست


  • 1398/06/06
  • ساعت 11:53

> Task :app:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with       Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:comm      and_line_warnings
13 actionable tasks: 2 executed, 11 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Cannot find System Java Compiler. Ensure that you have installed a JDK (not ju      st a JRE) and configured your JAVA_HOME system variable to point to the accordin      g directory.

* 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 33s

error Failed to install the app. Make sure you have the Android development envi      ronment set up: https://facebook.github.io/react-native/docs/getting-started.htm      l#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8      081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Cannot find System Java Compiler. Ensure that you have installed a JDK (not ju      st a JRE) and configured your JAVA_HOME system variable to point to the accordin      g directory.

* 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 33s

    at checkExecSyncError (child_process.js:603:11)
    at execFileSync (child_process.js:621:13)
    at runOnAllDevices (D:\practice project\ReactNative\firstproject\node_module      s\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAl      lDevices.js:74:39)
    at buildAndRun (D:\practice project\ReactNative\firstproject\node_modules\@r      eact-native-community\cli-platform-android\build\commands\runAndroid\index.js:15      8:41)
    at then.result (D:\practice project\ReactNative\firstproject\node_modules\@r      eact-native-community\cli-platform-android\build\commands\runAndroid\index.js:12      5:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)
 


  • 1398/06/06
  • ساعت 11:58

JDK نصب کردید؟ چک کنید که JDK باشه نه JRE

و مسیر JAVA_HOME رو به عنوان متغییر محیطی مانند ANDROID_HOME بسازید


  • 1398/06/06
  • ساعت 13:26

بله نصبه مسیر رو بهش میدم ولی باز ارور میده

مسیر دیفالت همینه دیگه درسته؟؟

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
 


  • 1398/06/06
  • ساعت 14:17

باید فولدر /bin رو هم بهش بدید


  • 1398/06/06
  • ساعت 16:21

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk-12.0.2\bin

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
 

باز هم ارور میگیره!

jdk 12 هم نصب کردم باز همون ارور رو میده


  • 1398/06/06
  • ساعت 16:46

ورژن ۸ استفاده کنید

بعد تعریف متغییر محیطی JAVA_HOME و دادن مقدار مسیر ریستارت کنید سیستم رو دوباره چک کنید

برخی مواقع باید /bin باشه اگر درست نشد /bin رو بردارید


  • 1398/06/06
  • ساعت 19:23

بالاخره درست شد:))

فایلهای jdk رو کامل پاک کردم و دوباره نصب کردم اوکی شد و مسیر هم بدون /bin

واقعا ممنونم از راهنمایی و پاسخگویی باحوصلتون 


logo-enamadlogo-samandehi