课程案例启动报错

来源:1-2 课程导学

慕瓜5307192

2018-12-27

搭建的环境正常,跑github_advanced 报错内容如下:
A problem occurred configuring project ‘:react-native-webview’.

Could not resolve all files for configuration ‘:react-native-webview:classpath’.
Could not resolve com.android.tools.build:gradle:3.2.1.
Required by:
project :react-native-webview
Could not resolve com.android.tools.build:gradle:3.2.1.
Could not get resource ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom’.
Could not GET ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom’.
Connect to dl.google.com:443 [dl.google.com/127.0.1.2] failed: Connection refused: connect
Could not resolve com.android.tools.build:gradle:3.2.1.
Could not get resource ‘https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom’.
Could not GET ‘https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom’.
Connect to jcenter.bintray.com:443 [jcenter.bintray.com/127.0.1.3] failed: Connection refused: connect
Could not resolve com.android.tools.build:gradle:3.2.1.
Could not get resource ‘https://maven.fabric.io/public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom’.
Could not GET ‘https://maven.fabric.io/public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom’.
Connect to maven.fabric.io:443 [maven.fabric.io/127.0.1.4] failed: Connection refused: connect
Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71.

写回答

1回答

CrazyCodeBoy

2018-12-27

相关的依赖库没有下载下来所致:

  • 在项目根目录运行 npm install 或yarn install;

  • 然后check  node_modules中是否有react-native-webview被安装进来;

  • 用AndroidStudio打开项目中的android目录,然后clean&build项目之后试一下;

另外,在仓库的doc目录下有个代码运行指南可以参考下哈。

0
1
慕瓜5307192
用AndroidStudio打开项目中的android目录,然后clean&build项目之后,还是报一样的错误,其他依赖都能成功下载,就缺“react-native-webview“
2018-12-28
共1条回复

RN入门到进阶,打造高质量上线App

解锁React Native开发应用新姿势,React Native新版本热门技术

3144 学习 · 3241 问题

查看课程