账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    react-native 搭建环境遇到的问题
    29
    0
    D:\reactnative\MyProject>react-native run-android
    Scanning folders for symlinks in D:\reactnative\MyProject\node_modules (44ms)
    JS server already running.
    Building and installing the app on the device (cd android && gradlew.bat install
    Debug)...
    Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reus
    ed, use --status for details
    NDK is missing a "platforms" directory.
    If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is
     currently set to D:\安卓\bin\ndk-bundle.
    If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.
    properties to remove this warning.
    
    java.net.UnknownHostException: dl.google.com
    Failed to connect to host: https://dl.google.com/android/repository/addons_list-
    3.xml
    Failed to connect to host: https://dl.google.com/android/repository/addons_list-
    2.xml
    Failed to connect to host: https://dl.google.com/android/repository/addons_list-
    1.xml
    Failed to download any source lists!
    File C:\Users\Administrator\.android\repositories.cfg could not be loaded.
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring project ':app'.
    > Failed to find Build Tools revision 26.0.3
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.
    
    BUILD FAILED
    
    Total time: 35.036 secs
    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.html
    
    D:\reactnative\MyProject>npm run android
    npm ERR! missing script: android
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-08-22T0
    2_59_02_079Z-debug.log
    
    D:\reactnative\MyProject>
    
    
    
    

    ==折腾我一天了 百度怎么弄也不对 请问哪里出错了

    0
    打赏
    收藏
    点击回答
        全部回答
    • 共 0 条
    • n乛3乛n 普通会员 1楼

      在React Native中,你可能会遇到各种问题。以下是一些常见的问题以及解决方案:

      1. 无法使用npm和yarn:React Native 使用npm作为包管理器,如果你在构建过程中遇到无法使用npm或yarn的问题,你需要确保你的系统已经安装了这些包。如果你的系统没有安装这些包,你可以使用npm install 或 yarn install 命令进行安装。

      2. 更新问题:React Native 会自动安装所有依赖项。如果你的项目需要更新,你可能需要手动安装所有依赖项。你可以在终端中使用以下命令进行更新:

      npm install

      1. 路径问题:如果你的项目放在了不同的目录下,你需要确保你的环境能够正确地找到这个目录。你可以在终端中使用以下命令进行路径检查:

      pwd

      1. 内存问题:如果你的项目在运行时占用了大量的内存,你可以尝试清理一些不必要的文件。你可以在终端中使用以下命令进行内存检查:

      free -m

      1. 错误消息:React Native 会生成一些错误消息,这些错误消息可以帮助你找到问题所在。你可以在终端中使用以下命令查看错误消息:

      node_modules/.bin/react-native doctor

      希望这些信息对你有所帮助!如果你还有其他问题,欢迎随时向我提问。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部