代码之家  ›  专栏  ›  技术社区  ›  Manoj Goel

在Android emulator上安装应用程序时配置根项目时出错

  •  0
  • Manoj Goel  · 技术社区  · 8 年前

    尝试在android emulator上运行react本机应用程序时,出现以下错误。请注意,android emulator已在运行。

    A problem occurred configuring root project 'MyReactNativeApp'.
    > Could not resolve all files for configuration ':classpath'.
       > Could not resolve com.android.tools.build:gradle:3.0.1.
         Required by:
             project :
          > Could not resolve com.android.tools.build:gradle:3.0.1.
             > Could not get resource 'https://jcenter.bintray.com/com/android/tools
    /build/gradle/3.0.1/gradle-3.0.1.pom'.
                > Could not GET 'https://jcenter.bintray.com/com/android/tools/build
    /gradle/3.0.1/gradle-3.0.1.pom'.
                   > jcenter.bintray.com
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 2s
    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
    

    任何帮助都将不胜感激。

    1 回复  |  直到 8 年前
        1
  •  0
  •   Manoj Goel    8 年前

    解决方案很简单。我所做的只是升级了react native,它解决了问题。

    react-native upgrade