2015-09-16 1 views
14

Problema durante l'esecuzione del run-android. Stavo affrontando un problema, immagino che sia un tizio per le dipendenze gradle.Build fallito su run-android a causa di dipendenze

Ho anche provato sudo, che sta dando qualche altro errore casuale dicendo $ ANDROID_HOME. Quale non è il problema

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. 

Dove ho sbagliato?

+0

tenta di aggiornare l'SDK di Android. Sembra che ci siano nuove versioni delle librerie. Rinnovare repository remoto e ricostruire – user2413972

risposta

11

Android Supporto Repository mancava installato, ancora una volta ha seguito tutti i passaggi qui: https://facebook.github.io/react-native/docs/android-setup.html

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

+3

Alcuni dei pacchetti sono stati rinominati, in particolare "Repository supporto Android" sembra essere stato rinominato in "repository Maven locale per librerie di supporto". L'installazione ha corretto l'errore per me. – beon

1

Non sembra che tu abbia aggiornato le tue librerie sulla tua macchina alla versione più recente. Scarica le nuove versioni della libreria di supporto/appcompat e riprova

1

Sembra che tu non abbia installato Android sdk e/o che il percorso non sia impostato correttamente. Ci sono istruzioni dettagliate su come fare questo nei documenti di configurazione di Android di reagire nativo, seguire le istruzioni per Install and configure SDK.

0

Per coloro che si verifichi questo problema quando si tenta di utilizzare semplicemente il Android SDK Manager (tools/android), ho dovuto correre il Responsabile SDK come root (es. sudo ./tools/android) per aggirare questo errore.

Sfortunatamente, l'esecuzione di un programma inoltrato X11 come root può a volte causare problemi. Se si verificano problemi durante il tentativo di eseguire il gestore SDK come utente root, vedere this answer here. In particolare, sono riuscito a eseguire il gestore SDK come utente normale, ma il tentativo di eseguire come root è sempre fallito.

2

Nel caso in cui, come me, nient'altro che hai letto ha lavorato, questo ha funzionato per me:

  1. check-in l'ultimo snapshot di modifiche al controllo del codice sorgente
  2. Rimuovere la directory del progetto dal sistema
  3. check out il codice dal controllo di origine
  4. npm cache clean && npm install
  5. watchman watch-del-all
  6. react-native start -- --reset-cache
  7. react-native run-android

: mente-soffiato: