Unable to compile my android app with "google-play-services" - android

I am trying to incorporate MixPanel in my Android application it requried google-play-services to the included as well. I added the following lines to my build.gradle
compile 'com.mixpanel.android:mixpanel-android:4.6.4'
compile 'com.google.android.gms:play-services:7.8.0'
I get the following error when I run $ gradle build --daemon
* What went wrong:
A problem occurred configuring root project 'git'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not find com.google.android.gms:play-services:7.8.0.
Searched in the following locations:
http://dl.bintray.com/glomadrian/maven/com/google/android/gms/play-services/7.8.0/play-services-7.8.0.pom
http://dl.bintray.com/glomadrian/maven/com/google/android/gms/play-services/7.8.0/play-services-7.8.0.jar
https://jcenter.bintray.com/com/google/android/gms/play-services/7.8.0/play-services-7.8.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services/7.8.0/play-services-7.8.0.jar
file:/home/prakash/Programming/Android/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services/7.8.0/play-services-7.8.0.pom
file:/home/prakash/Programming/Android/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services/7.8.0/play-services-7.8.0.jar
Required by:
:git:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Any idea what the issue is ?

All I needed to do was install
Google Play Services
Google Respository
through my **Android SDK Manager"
Thanks #mateus #invariant #gabriele

You almost never will need all play services API.
Take a look into this list and compile just what you really need.
Google Play Services APIs

Related

Lyft Android SDK integration issue

I added Lyft android SDK dependency in my app in dependency section of build.gradle file as below
implementation "com.lyft:lyft-android-sdk:1.0.3
But I am getting below error while running app on mobile device:-
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDevDebug'.
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 3m 33s
I try to solve above issue by adding multiDexEnabled true in default config of app gradle, but it doesn't work.
I am using Android Studio 3.0.1 and gradle 4.1 version.
I investigated issue more by enabling stack trace in gradle build process and looking out stack trace log.
In stack trace I found there is a duplicate class from org.jetbrains.annotations package which is coming from two different dependency module. one dependency module was from kotlin dependency and one was from lyft sdk dependency module. So I added Lyft sdk dependency as like below in build.gradle and it works for me.
implementation ("com.lyft:lyft-android-sdk:1.0.3"){
exclude group: 'org.jetbrains', module:'annotations-java5'
}

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

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.
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:+.

Android Studio 2: Google Play dependencies error

I just switched to Android Studio 2 and I'm trying to use Google Play services in my app. But I faced a really strange from the very beginning. Adding to Gradle.build such dependencies:
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0
cause error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: /media/valentyn/Seagate Backup Plus Drive/workspace/Studio Projects
16.02.16/LocalVenues/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/8.4.0/AndroidManifest.xml (No such file or directory) Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Can it be some conflict with installed libraries in SDK Manager or what else?
I had the same kind of problem, caused by the new Instant Run in Android Studio 2, I solved it with:
Build > Rebuild Project
Run again.
The funny thing that this issue was related to NTFS file system of my portable driver. After moved my project, this problem was solved.

Could not find com.android.support:support-v4:21.0.2

I m using Android Studio v0.8.6
I have an Android app using google-play-service and I get this error when I try to build:
Executing tasks: [clean, :libraries:BaseGameUtils:generateDebugSources, :app:generateDebugSources]
Configuration on demand is an incubating feature.
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
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:support-v4:21.0.2.
Required by:
RIGHTER-android:app:unspecified
RIGHTER-android:app:unspecified > com.google.android.gms:play-services:6.1.11
RIGHTER-android:app:unspecified > RIGHTER-android.libraries:BaseGameUtils:unspecified > com.android.support:appcompat-v7:20.0.0
> Could not find com.android.support:support-v4:21.0.2.
Required by:
RIGHTER-android:app:unspecified > RIGHTER-android.libraries:BaseGameUtils:unspecified
> Could not find com.android.support:support-v4:21.0.2.
Required by:
RIGHTER-android:app:unspecified > com.github.filippudak.progresspieview:library:1.0.4
* 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: 3.405 secs
This Error just happened recently and I didn't update a thing.
Any help will be appreciated, Thanks in advance!
Don't forget to update the Android SDK Manager once in a while :-}
AS I can understand my comment: "Can you check in Android SDK Manager if you have installed Android Support Library 21.0.2?" helped you.
But coming to core of issue. I think, that core of your issue was dependencies part in build.gradle. I strongly believe, that in:
compile 'com.google.android.gms:play-services:x.y.z'
you had somewhere '+', and it means, that version of library, that you are using is not set once, and can change, and this happened with Google Play Services Library.
Always try to put full version number of library, to not have this kind of issues in feature.
Just open the Android SDK manager and install the Android Support Library and the Android Support Repository.

Android Fit API Basic Sensors Sample Fails to Build

I'm unable to build the Android Fit basic sensors sample due to a missing dependency. I'm new to gradle so I don't know how to fix the build issue. How do I add this missing dependency?
Pre-requisites says:
Android API Level >v9
Android Build Tools >v19
Android Support Repository
My environment:
Android SDK Build-tools: 23.0.5
Android 5.0 (API 21)
Android Support Repository 7
Android Support Library 21
Google Play services 21
Build:
$ gradlew build
Relying on packaging to define the extension of the main artifact has
been deprecated and is scheduled to be removed in Gradle 2.0
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 any version that matches
com.google.android.gms:play-services:6.1.+.
Required by: BasicSensorsApi:app:unspecified 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: 4.582 secs
You need to install the Google Repository as well:
https://developer.android.com/sdk/installing/adding-packages.html

Categories

Resources