• 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{随机文件夹}

    出处:http://www.cnblogs.com/lipanpan/

    本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

     
  • 相关阅读:
    Codeforces1335F Robots on a Grid
    BJOI2014 大融合
    洛谷 P1463 [SDOI2005]反素数ant && codevs2912反素数
    codeforce 570 problem E&& 51Nod-1503-猪和回文
    洛谷noip 模拟赛 day1 T1
    noip 2010 三国游戏
    noip 2013 华容道
    汕头市队赛 SRM 07 D 天才麻将少女kpm
    noip2012 普及组
    汕头市队赛 SRM 08 B
  • 原文地址:https://www.cnblogs.com/lguow/p/9182911.html
Copyright © 2020-2023  润新知