React Native run-android构建失败

时间:2015-09-28 17:48:59

标签: android maven react-native

我在Mac OS X上遵循了react-native android的设置指南。我正在运行模拟器。当我运行react-native run-android时,我得到以下结果:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find any matches for com.android.support:appcompat-v7:23.0.+ as no versions of com.android.support:appcompat-v7 are available.
     Searched in the following locations:
         file:/Users/hugo/.m2/repository/com/android/support/appcompat-v7/maven-metadata.xml
         file:/Users/hugo/.m2/repository/com/android/support/appcompat-v7/
         https://jcenter.bintray.com/com/android/support/appcompat-v7/maven-metadata.xml
         https://jcenter.bintray.com/com/android/support/appcompat-v7/
     Required by:
         fuckoff:app:unspecified
   > Could not find com.android.support:appcompat-v7:22.2.0.
     Searched in the following locations:
         file:/Users/hugo/.m2/repository/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.pom
         file:/Users/hugo/.m2/repository/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.jar
         https://jcenter.bintray.com/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.pom
         https://jcenter.bintray.com/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.jar
     Required by:
         fuckoff: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/hugo/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
         file:/Users/hugo/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar
         https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
         https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar
     Required by:
         fuckoff:app:unspecified > com.facebook.react:react-native:0.11.0 > com.facebook.fresco:fresco:0.6.1 > com.facebook.fresco:drawee:0.6.1
         fuckoff:app:unspecified > com.facebook.react:react-native:0.11.0 > com.facebook.fresco:fresco:0.6.1 > com.facebook.fresco:imagepipeline:0.6.1

我安装了所有必需的Android SDK包,包括构建工具和支持存储库。我注意到它正在我家中寻找一个名为.m2的目录,该目录不存在。我从来不需要Maven来做android开发。我是否需要安装它以使用react-native?

1 个答案:

答案 0 :(得分:3)

为了绝对安全,我尝试使用android update sdk --no-ui更新Android软件包。

显然,我使用android安装的软件并不是最新的。运行更新解决了问题。