新手求助grade报错!



  • JS server already running.
    Building and installing the app on the device (cd android && gradlew.bat installDebug)...
    错误: 找不到或无法加载主类 org.gradle.wrapper.GradleWrapperMain                                                                                                                                                                                                                                                  
    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
    

    新手请问这个是要怎么解决呢,android目录下有grade目录了呀?



  • C:\Users\XXX.gradle\wrapper\dists 这个目录下有gradle构建工具吗?



  • 看错误信息是说无法安装到设备上。

    1,安装前是否已启动好虚拟机
    2,之前安装好的应用包信息和当前不一致,可以先卸载应用再安装。

    我只遇到过这两种情况,希望对你有帮助。



  • @liaoyongfu
    要确保你有模拟器在运行,或者有手机设备连接,不然脚本运行的时候无法自动给你安装apk,或者你可以cd到android目录下,直接执行./gradlew assembleDebug打debug包出来


登录后回复