无法运行示例应用程序



在此处的教程之后,我无法在模拟器中运行该应用程序。当我从DOS提示执行react-native run-android命令时,这是我遇到的错误:

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'AwesomeProject'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:2.2.3.
     Required by:
         :AwesomeProject:unspecified
      > Could not resolve com.android.tools.build:gradle:2.2.3.
         > Could not get resource 'https://repo1.maven.org/maven2/com/android/to
ols/build/gradle/2.2.3/gradle-2.2.3.pom'.
            > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/bu
ild/gradle/2.2.3/gradle-2.2.3.pom'.
               > repo1.maven.org
      > Could not resolve com.android.tools.build:gradle:2.2.3.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools
/build/gradle/2.2.3/gradle-2.2.3.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build
/gradle/2.2.3/gradle-2.2.3.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.

我尝试过的东西:

  1. 编辑build.gradle文件和更改classpath从classpath'com.android.tools.build:gradle:2.2.3'到com.android.tools.build:3.3.30'(我已安装的版本Android Studio)。
  2. 验证了jcenter()在buildscript和allproject下的build.gradle中被列为一个存储库

尝试将其设置为2.3.0

奇怪的是,我在那条路中看不到任何2.2.3,但我可以看到2.3.0http://repo1.maven.org/maven2/com/android/tools/build/gradle/

我使用反应生态CLI重新创建了该项目,并且问题似乎是纠正的。我应该注意,我相信我最初创建该项目时没有安装Android Studio,所以也许与此有关,不确定。

相关内容

  • 没有找到相关文章

最新更新