简体   繁体   English

cordova / platforms / android / gradlew:命令失败,退出代码为1错误输出:

[英]cordova /platforms/android/gradlew: Command failed with exit code 1 Error output:

I HAVE THIS ERROR WITH cordova-onesignal-plugin installed 安装了cordova-onesignal-plugin时出现此错误

On build app in ionic 在ionic上构建应用程序

sudo ionic build android

sudo cordova build android

Error: /platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception. 错误:/ platforms / android / gradlew:命令失败,退出代码为1错误输出:FAILURE:构建失败,出现异常。

  • What went wrong: A problem occurred configuring root project 'android'. 出了什么问题:配置根项目“ android”时出现问题。

    Could not resolve all dependencies for configuration ':_debugCompile'. 无法解析配置':_debugCompile'的所有依赖项。 Could not find any matches for com.google.android.gms:play-services-gcm:+ as no versions of com.google.android.gms:play-services-gcm are available. 找不到com.google.android.gms:play-services-gcm:+的任何匹配项,因为没有可用的com.google.android.gms:play-services-gcm版本。 Searched in the following locations: repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/ jcenter.bintray.com/com/google/android/gms/play-services-gcm/maven-metadata.xml jcenter.bintray.com/com/google/android/gms/play-services-gcm/ file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-gcm/ Required by: :android:unspecified Could not find any matches for com.google.android.gms:play-services-analytics:+ as no versions of com.google.android.gms:play-services-analytics are available. 在以下位置搜索:repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml repo1.maven.org/maven2/com/google/android/gms/play -services-gcm / jcenter.bintray.com/com/google/android/gms/play-services-gcm/maven-metadata.xml jcenter.bintray.com/com/google/android/gms/play-services-gcm/文件:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml文件:/ usr / local / Cellar /android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-gcm/必需的::android:unspecified找不到与com.google.android.gms的任何匹配项: play-services-analytics:+,因为没有可用的com.google.android.gms:play-services-analytics版本。 Searched in the following locations: repo1.maven.org/maven2/com/google/android/gms/play-services-analytics/maven-metadata.xml repo1.maven.org/maven2/com/google/android/gms/play-services-analytics/ jcenter.bintray.com/com/google/android/gms/play-services-analytics/maven-metadata.xml jcenter.bintray.com/com/google/android/gms/play-services-analytics/ file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-analytics/maven-metadata.xml file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-analytics/ Required by: :android:unspecified Could not find any matches for com.google.android.gms:play-services-location:+ as no versions of com.google.android.gms:play-services-location are available. 在以下位置搜索:repo1.maven.org/maven2/com/google/android/gms/play-services-analytics/maven-metadata.xml repo1.maven.org/maven2/com/google/android/gms/play -services-analytics / jcenter.bintray.com/com/google/android/gms/play-services-analytics/maven-metadata.xml jcenter.bintray.com/com/google/android/gms/play-services-analytics/文件:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-analytics/maven-metadata.xml文件:/ usr / local / Cellar /android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-analytics/必需::android:unspecified找不到com.google.android.gms的任何匹配项: play-services-location:+,因为没有可用的com.google.android.gms:play-services-location版本。 Searched in the following locations: repo1.maven.org/maven2/com/google/android/gms/play-services-location/maven-metadata.xml repo1.maven.org/maven2/com/google/android/gms/play-services-location/ jcenter.bintray.com/com/google/android/gms/play-services-location/maven-metadata.xml jcenter.bintray.com/com/google/android/gms/play-services-location/ file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-location/maven-metadata.xml file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-location/ Required by: :android:unspecified 在以下位置搜索:repo1.maven.org/maven2/com/google/android/gms/play-services-location/maven-metadata.xml repo1.maven.org/maven2/com/google/android/gms/play -services-location / jcenter.bintray.com/com/google/android/gms/play-services-location/maven-metadata.xml jcenter.bintray.com/com/google/android/gms/play-services-location/文件:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-location/maven-metadata.xml文件:/ usr / local / Cellar /android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-location/所需的::android:unspecified

  • Try: Run with --stacktrace option to get the stack trace. 尝试:使用--stacktrace选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output. 使用--info或--debug选项运行以获取更多日志输出。

Try installing "Google Repository" under Preferences > Appearance & Behavior > System Settings > Android SDK > SDK Tools in your Android Studio. 尝试在Android Studio中的“ 偏好设置”>“外观和行为”>“系统设置”>“ Android SDK”>“ SDK工具 ”下安装“ Google Repository”。 Worked for me. 为我工作。

From the Android Studio docs , you will see: Android Studio文档中 ,您将看到:

Google Repository Recommended. Google存储库推荐。 Includes local Maven repository for Google libraries, which provide a variety of features and services for your apps, such as Google sign-in, Google Maps, Games achievements and leaderboards, and much more. 包括适用于Google图书馆的本地Maven存储库,可为您的应用程序提供各种功能和服务,例如Google登录,Google Maps,Games成就和排行榜等。

My bet is that this includes com.google.android.gms:play-services-gcm:+ . 我敢打赌,这包括com.google.android.gms:play-services-gcm:+

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误是:命令 ./gradlew 失败,退出代码为 1 - Error is: Command ./gradlew failed with exit code 1 cordova 要求 android 目标未安装 cmd:命令失败,退出代码为 1 错误输出: - cordova requirements android target not installed cmd: Command failed with exit code 1 Error output: 在Android模拟器上运行Cordova错误:“android:命令失败,退出代码为2” - Cordova error running on android emulator: “android: Command failed with exit code 2” NativeScript Android Build引发错误:命令gradlew.bat失败,退出代码为1 - NativeScript Android Build throws error: Command gradlew.bat failed with exit code 1 错误:命令 gradlew.bat 失败,退出代码为 1 - Error: Command gradlew.bat failed with exit code 1 Cordova-错误:cmd:命令失败,退出代码为1 - Cordova - Error: cmd: Command failed with exit code 1 Cordova Android - ERROR构建其中一个平台:命令的错误代码1: - Cordova Android - ERROR building one of the platforms: Error code 1 for command: 科尔多瓦添加平台android命令失败 - cordova add platforms android command failed cordova build android 错误:系统找不到指定的路径。 错误:cmd:命令失败,退出代码为 1 - cordova build android error : The system cannot find the path specified. Error: cmd: Command failed with exit code 1 Cordova:Android 目标:未安装 avdmanager:命令失败,退出代码为 1 - Cordova: Android target: not installed avdmanager: Command failed with exit code 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM