【问题标题】:React Native: Could not find support-vector-drawable.aar [duplicate]React Native:找不到support-vector-drawable.aar [重复]
【发布时间】:2019-03-28 10:40:08
【问题描述】:

我运行 react-native 0.57.1​​ 应用程序,然后我得到以下几行。

FAILURE: Build failed with an exception.
* What went wrong:
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
  • 我的 react native 项目也有同样的问题。我正在尝试在 Ubuntu 中运行该项目,该项目在 Windows 中运行良好
  • 在 android studio 上打开该项目并同步并尝试运行
  • 所有 com.android.support 库必须使用完全相同的版本。检查您的 android Gradle 文件中的版本。这个stackoverflow.com/questions/42374151/… 将帮助你了解它。

标签: android react-native


【解决方案1】:

以下为我工作, 尝试将google() 作为第一个 repo,如下所示。 对于您现有的 Android Studio 项目,请勿将其放在 jcenter()mavenCentral() 下。 并且只需在模块的build.gradle 中的allprojects > repositories 中从下到上移动google()

原来是here is the answer

【讨论】:

  • 太棒了!谢谢你的时间^_^
【解决方案2】:

我将它发布在我的 Github 上,然后我得到了答案:https://github.com/facebook/react-native/issues/21916。只需在android/build.gradle 上,我将google() 移动到列表中的第一个元素。谢谢大家!

【讨论】:

    【解决方案3】:

    使用 android studio 打开您的 android 应用程序。然后尝试构建它。它会给你一个导致失败的直接信息。它也会建议您进行修复。然后尝试通过它运行它。

    很可能存在版本同谋。所有 com.android.support 库必须使用完全相同的版本。检查您的 android Gradle 文件中的版本。这个All com.android.support libraries must use the exact same version specification 将帮助你了解它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-24
      • 2020-01-11
      • 2020-04-28
      相关资源
      最近更新 更多