Hugo
Hugo

Reputation: 2444

React Native run-android build fails

I've followed the setup guide for react-native android on Mac OS X. I have the emulator running. When I run react-native run-android I get the following:

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

I have all the necessary Android SDK packages installed including the build tools and the support repository. I'm noticing that it's looking for a directory in my home called .m2, which doesn't exist. I've never needed Maven to do android development. Do I need to install it to use react-native?

Upvotes: 3

Views: 1739

Answers (1)

Hugo
Hugo

Reputation: 2444

Just to be absolutely safe, I tried updating the android packages using android update sdk --no-ui.

Apparently the software I installed using android weren't the most up to date. Running the update fixed the issue.

Upvotes: 3

Related Questions