zoukankan      html  css  js  c++  java
  • ReactNative问题随记1 Exception in thread "main" java.lang.RuntimeException: gradle-2.14.1-all.zip

    ReactNative问题随记

    想运行在真机上,在运行命令react-native run-android遇到错误如下:

    Scanning 559 folders for symlinks in D:AppDataProjectandroidAwesomeProject ode_modules (46ms)
    JS server already running.

    Building and installing the app on the device (cd android && gradlew.bat installDebug)...
    Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:Userslipp.gradlewrapperdistsgradle-2.14.1-all8bnwg5hd3w55iofp58khbp6yvgradle-2.14.1-all.zip
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:61)
    at org.gradle.wrapper.Install.createDist(Install.java:46)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
    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/android-setup.html

    截图如下:

     去路径上去找发现缺少文件,首次运行命令react-native run-android 会下载gradle编译器,虽然设置了但一直失败

    解决方案:

    1.直接去下:http://services.gradle.org/distributions/   找到文件对应版本的文件 gradle-2.14.1-all.zip 下载

    打不开的可以去我网盘上下载:https://pan.baidu.com/s/1nvealoX  (gradle-2.14.1-all.zip)

    下载后放到C:Userslipp.gradlewrapperdistsgradle-2.14.1-all8bnwg5hd3w55iofp58khbp6yv   下,然后右键该文件属性,看是否被锁定,如果锁定点击解除锁定

    注意文件路径一般是:C:Users{你的账号}.gradlewrapperdistsgradle-2.14.1-all{随机文件夹}

  • 相关阅读:

    bzoj3052: [wc2013]糖果公园
    莫队算法心得
    bzoj1104: [POI2007]洪水pow
    bzoj1102: [POI2007]山峰和山谷Grz
    bzoj1121: [POI2008]激光发射器SZK
    bzoj1113: [Poi2008]海报PLA
    bzoj1103: [POI2007]大都市meg
    bzoj1396: 识别子串
    bzoj3756: Pty的字符串
  • 原文地址:https://www.cnblogs.com/lipanpan/p/7419335.html
Copyright © 2011-2022 走看看