2
votes

I HAVE THIS ERROR WITH cordova-onesignal-plugin installed

On build app in 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.

  • What went wrong: A problem occurred configuring root project 'android'.

    Could not resolve all dependencies for configuration ':_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. 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. 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. 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

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

1
You need to download and install google services with Android SDK.e666
Not works! I've already triedArley HR

1 Answers

4
votes

Try installing "Google Repository" under Preferences > Appearance & Behavior > System Settings > Android SDK > SDK Tools in your Android Studio. Worked for me.

From the Android Studio docs, you will see:

Google Repository Recommended. 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.

My bet is that this includes com.google.android.gms:play-services-gcm:+.