3

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?

3
  • you probably do have a .m2 directory. (it is not visible in finder with the default settings). It is were the support libraries are, under a maven repo, which is how gradle satisfies the compile dependencies (other dependencies are satisfied using online repos, like maven central, but android support is local). Commented Sep 28, 2015 at 18:11
  • you just need to update the support repository in the SDK Tools section. Commented Sep 28, 2015 at 18:12
  • @njzk2 I found the answer, I just can't accept it, but thanks. Commented Sep 28, 2015 at 22:56

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot, Hugo. I've installed the repo from SDK manager but didn't work. Running the update command solved the issue!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.