Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build failed on run-android due to dependencies

Problem while running the run-android. I was facing a problem, I guess it's dude to the gradle dependencies.

I have even tried sudo, which is giving some other random error saying $ANDROID_HOME. Which isn't the problem.

JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

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 com.android.support:appcompat-v7:23.0.0.
     Searched in the following locations:
         file:/Users/iraycd/.m2/repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
         file:/Users/iraycd/.m2/repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
         https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
         https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
     Required by:
         AwesomeProject:app:unspecified
   > Could not find com.android.support:appcompat-v7:23.0.0.
     Searched in the following locations:
         file:/Users/iraycd/.m2/repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
         file:/Users/iraycd/.m2/repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
         https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
         https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
     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/iraycd/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
         file:/Users/iraycd/.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:
         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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 11.247 secs
Could not install the app on the device, see the error above.

Where did I go wrong?

like image 874
iraycd Avatar asked Sep 16 '15 19:09

iraycd


2 Answers

Android Support Repository was missing installed, again followed all the steps here: https://facebook.github.io/react-native/docs/android-setup.html

https://github.com/facebook/react-native/issues/2772#issuecomment-140843907

like image 149
iraycd Avatar answered Sep 22 '22 12:09

iraycd


In case, like me, nothing else you've read has worked, this worked for me:

  1. Check in the latest snapshot of changes to your source control
  2. Remove the project directory from your system
  3. Check out your code from source control
  4. npm cache clean && npm install
  5. watchman watch-del-all
  6. react-native start -- --reset-cache
  7. react-native run-android

:mind-blown:

like image 44
codenamev Avatar answered Sep 25 '22 12:09

codenamev