【发布时间】:2015-10-08 18:08:52
【问题描述】:
我正在尝试学习 react-native,但无法构建演示 AwesomeProject。我在~/.bash_profilefile 中设置了$ANDROID_HOME 变量。但是每次我构建它时都会出现以下错误。
出了什么问题:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find com.android.support:appcompat-v7:23.0.1.
Searched in the following locations:
file:/Users/<username>/.m2/repository/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom
file:/Users/<username>/.m2/repository/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar
Required by:
AwesomeProject:app:unspecified
Could not find com.android.support:appcompat-v7:23.0.1.
Searched in the following locations:
file:/Users/<username>/.m2/repository/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom
file:/Users/<username>/.m2/repository/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar
https link Required by:
AwesomeProject:app:unspecified > com.facebook.react:react-native:0.11.0
Could not find com.android.support:support-v4:21.0.3.
Searched in the following locations:
file:/Users/<username>/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
file:/Users/<username>/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar
https link
Required by:
AwesomeProject:app:unspecified > com.facebook.react:react-native:0.11.0 > com.facebook.fresco:fresco:0.6.1 > com.facebook.fresco:drawee:0.6.1
AwesomeProject:app:unspecified > com.facebook.react:react-native:0.11.0 > com.facebook.fresco:fresco:0.6.1 > com.facebook.fresco:imagepipeline:0.6.1
我不知道它为什么要在这个文件夹文件中查找:
/Users/<username>/.m2/repository/com/android/support/appcompat-v7/23.0.1
安装的 sdk 版本是 23.0.1 我仍然收到此错误。
我有尝试学习 react-native 的 dotnet 背景。
【问题讨论】:
-
我遇到了同样的问题,您是否完全按照 Facebook 的说明进行操作? facebook.github.io/react-native/docs/android-setup.html 这就是我的工作方式,当我手动安装东西而不按照它给我的指示时,它给了我同样的错误。
-
我必须在 Extras 中安装 Android Support Repository。它成功了:)
-
请注意,现在已重命名为“支持库的本地 Maven 存储库”。
标签: react-native