由于依赖关系,在 运行-android 上构建失败
Build failed on run-android due to dependencies
在 运行 连接 运行-android 时出现问题。我遇到了一个问题,我想这是 gradle 依赖项的问题。
我什至尝试过 sudo,它给出了一些其他的随机错误 $ANDROID_HOME。这不是问题。
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.
我哪里错了?
您似乎没有将计算机上的库更新到最新版本。下载新版本的支持library/appcompat然后重试
您似乎没有安装 android sdk and/or 它的路径设置不正确。在 react native 的 android 设置文档中有关于如何执行此操作的详细说明,请按照 Install and configure SDK.
的说明进行操作
Android 缺少安装支持存储库,再次按照此处的所有步骤操作:https://facebook.github.io/react-native/docs/android-setup.html
https://github.com/facebook/react-native/issues/2772#issuecomment-140843907
对于那些在尝试简单地使用 Android SDK Manager
(tools/android
) 时遇到此问题的人,我不得不 运行 SDK 管理器作为根用户(例如 sudo ./tools/android
) 来绕过这个错误。
不幸的是,运行将 X11 转发的程序设置为 root 有时会带来其自身的问题。如果您在尝试以 root 身份 运行 SDK 管理器时遇到问题,请参阅 this answer here。具体来说,我能够以普通用户身份 运行 SDK 管理器,但尝试以 root 身份 运行 总是失败。
以防万一,像我一样,你读过的其他任何东西都没有用,这对我有用:
- 查看源代码管理更改的最新快照
- 从系统中删除项目目录
- 从源代码管理中检查您的代码
npm cache clean && npm install
watchman watch-del-all
react-native start -- --reset-cache
react-native run-android
:令人震惊:
您似乎没有 android 安装 sdk and/or 它的路径设置不正确。在 React Native 的 android 安装文档中有关于如何执行此操作的详细说明,请按照安装和配置 SDK 的说明进行操作。
在 运行 连接 运行-android 时出现问题。我遇到了一个问题,我想这是 gradle 依赖项的问题。
我什至尝试过 sudo,它给出了一些其他的随机错误 $ANDROID_HOME。这不是问题。
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.
我哪里错了?
您似乎没有将计算机上的库更新到最新版本。下载新版本的支持library/appcompat然后重试
您似乎没有安装 android sdk and/or 它的路径设置不正确。在 react native 的 android 设置文档中有关于如何执行此操作的详细说明,请按照 Install and configure SDK.
的说明进行操作Android 缺少安装支持存储库,再次按照此处的所有步骤操作:https://facebook.github.io/react-native/docs/android-setup.html
https://github.com/facebook/react-native/issues/2772#issuecomment-140843907
对于那些在尝试简单地使用 Android SDK Manager
(tools/android
) 时遇到此问题的人,我不得不 运行 SDK 管理器作为根用户(例如 sudo ./tools/android
) 来绕过这个错误。
不幸的是,运行将 X11 转发的程序设置为 root 有时会带来其自身的问题。如果您在尝试以 root 身份 运行 SDK 管理器时遇到问题,请参阅 this answer here。具体来说,我能够以普通用户身份 运行 SDK 管理器,但尝试以 root 身份 运行 总是失败。
以防万一,像我一样,你读过的其他任何东西都没有用,这对我有用:
- 查看源代码管理更改的最新快照
- 从系统中删除项目目录
- 从源代码管理中检查您的代码
npm cache clean && npm install
watchman watch-del-all
react-native start -- --reset-cache
react-native run-android
:令人震惊:
您似乎没有 android 安装 sdk and/or 它的路径设置不正确。在 React Native 的 android 安装文档中有关于如何执行此操作的详细说明,请按照安装和配置 SDK 的说明进行操作。