android - 无法解析 React Native 中配置 ':app:debugCompileClasspath' 的所有文件

标签 android react-native

在使用 react-native init 设置 React Native 后,我尝试运行 react-native run-android,因为我讨厌 expo。 但是,我在这里遇到这样的问题:

Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find support-vector-drawable.aar (com.android.support:support-vector-drawable:27.1.1).
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/support/support-vector-drawable/27.1.1/support-vector-drawable-27.1.1.aar
> Could not find livedata-core.aar (android.arch.lifecycle:livedata-core:1.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/lifecycle/livedata-core/1.1.0/livedata-core-1.1.0.aar
> Could not find viewmodel.aar (android.arch.lifecycle:viewmodel:1.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/lifecycle/viewmodel/1.1.0/viewmodel-1.1.0.aar
> Could not find runtime.aar (android.arch.core:runtime:1.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/core/runtime/1.1.0/runtime-1.1.0.aar

关于如何让它工作的任何想法?我尝试了所有可能的问题,但似乎都没有用!

最佳答案

这成功了! 只需在模块的 build.gradle 中的 allprojects > repositories 中将 google() 从底部移动到顶部。 引用 -> https://stackoverflow.com/a/52950717/8237551

关于android - 无法解析 React Native 中配置 ':app:debugCompileClasspath' 的所有文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52961697/

相关文章:

android - 如何删除 Android 操作栏的底部边框?

android - Android日历标准按钮中的加号和减号按钮吗?

javascript - fetch 返回 SyntaxError : Unexpected token T in JSON at position 0

react-native - react native : Device has no app to handle URI

react-native - React Native中可能存在未处理的Promise Rejection网络错误

react-native - React Native打包js时如何防止节点内存不足

android - 如何在android运行时添加 fragment

android - 访问电子邮件帐户信息

android - 从循环中添加日历事件。

javascript - 图像选择器返回 uri `content://media/`,没有 React Native 中的扩展名