Android Google Map : Error in android google map - android

I used google map in android version new 2.2 and I get same messages error in messages gradle build.
and event log
I don't know where is the problem. Can anyone help me?

Your project is exceeding 65536 methods. This is likely because you are importing the whole Google Play Services library doing
dependencies {
compile 'com.google.android.gms:play-services:9.6.1'
}
You can import only the modules that you are going to use. If you are only using Google Maps you can change your Play Services dependency to be
dependencies {
compile 'com.google.android.gms:play-services-maps:9.6.1'
}

Related

Android - Warning after update google play service

After update my google play service version to last released version, when enable minify in debug or release the following warning shown and task not complete.
Warning:io.nlopez.smartlocation.activity.ActivityStore: can't find referenced method 'DetectedActivity(int,int,int)' in program class com.google.android.gms.location.DetectedActivity
Updated version : compile 'com.google.android.gms:play-services:10.2.0'
I add this line in my gradle apply plugin: 'com.google.gms.google-services'
Can anyone help me ?
I found the issue i use this Library in my project and Google play services version 10.2.0 is incompatible with this library
Try to add Google Play Service location package:
compile 'com.google.android.gms:play-services-location:10.2.0'
Also you should check SmartLocation library description, last compatible version of Google Play Services 10.0.1:
https://github.com/mrmans0n/smart-location-lib
...
Google Play Services compatible version: 10.0.1
So, I think, you should downgrade Grade Google Play service to v. 10.0.1, is you use SmartLocation library

Android studio build gradle sync failed

I am trying to add google play service to my project but it gives me error when I try to edit build (Gradle).
How can I fix it?
In your configuration there some issues.
You are using the wrong build.gradle file.
It is your top-level file.
You should add this line in your app/build.gradle
There is a typo. You are missing the ' at the end of the line compile.
Use an updated version.
For example use:
apply plugin: 'com.android.application'
...
dependencies {
compile 'com.google.android.gms:play-services:8.1.0'
}
Finally refer this official doc for more info.
In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit.
For example if you need to make only your app aware of location updates add
compile 'com.google.android.gms:play-services-location:8.1.0' only in gradle or if you need only map choose compile 'com.google.android.gms:play-services-maps:8.1.0'.
Please replace
compile 'com.google.android.gms:play-services:3.1.36
with
compile 'com.google.android.gms:play-services:3.1.36'
One thing you can try is Right Click on app open module settings on Dependencies Tab click '+' icon and add there 'com.google.android.gms:play-services:8.1.0' and click search icon and add that dependency,
So i don't want to elaborate what you had done wrong as my colleagues figured it out.I like to say, while playing with Google Play Service
Selectively compile APIs into your executable
In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit.
For example if you need to make only your app aware of location
updates add compile
'com.google.android.gms:play-services-location:8.1.0' only in gradle
or if you need only map choose compile
'com.google.android.gms:play-services-maps:8.1.0'.
Thank you.
Visit for more.

GooglePlayServices is not working with the project

I am working on a project where I have to authenticate a user with the Google plus and I did that. Now I have shifted my project from one PC to another for some reasons. I have made changes on developers console but when I try to login with google plus after launching, it says "Google Play Services not available. This application will close."
Why this error comes when everything is fine?
gradle dependencies is as follows:
dependencies {
compile 'com.android.support:support-v4:+'
compile 'com.google.code.gson:gson:1.7'
compile 'com.google.android.gms:play-services:+'
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}
Make sure that the device (or the emulator) where you're running the app has Google Play Services installed with the latest version (currently at least 8.1.0), or set exact (earlier) version in your build.gradle.

Execution failed for task ':packageAllDebugClassesForMultiDex'

I am try to use the new android multidex support for a project. I have some problem with this exception:
Error:Execution failed for task ':shineV3:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException: duplicate entry: com/google/android/gms/analytics/internal/Command$1.class
about the problem. I use 2 different jar package as dependency, and some class will be duplicated in classes.dex because both jars contains they. any idea?
thanks in Advance
For those that are coming into this, I figured out why this was happening. For me it was that I was compiling the Google Analytics V2 jar as well as the full play services. Google allows you to break down what play services you really need for you app and compile those individual items. Check them out here. I excluded the Google Play Analytics which is on V4 right now and it worked
If you are integrating Google Analytics V2 and Google play services in your app, then you need to do the following in your gradle file:
dependencies {
compile 'com.google.android.gms:play-services:4.0.30'
compile files('libs/libGoogleAnalyticsServices.jar')
}
It worked for me. Hope it will work for others too. :)
adding this to your grdale compile "com.google.android.gms:play-services:7.5.+" means adding all play services including analytics, maps, vcm .. etc. you can add
as guides mentions:
In versions of Google Play services prior to 6.5, you had to compile
the entire package of APIs into your app. In some cases, doing so made
it more difficult to keep the number of methods in your app (including
framework APIs, library methods, and your own code) under the 65,536
limit.
From version 6.5, you can instead selectively compile Google Play
service APIs into your app. For example, to include only the Google
Fit and Android Wear APIs, replace the following line in your
build.gradle file:
compile 'com.google.android.gms:play-services:7.5.0' with these lines:
compile 'com.google.android.gms:play-services-fitness:7.5.0' compile
'com.google.android.gms:play-services-wearable:7.5.0'
https://developers.google.com/android/guides/setup

Google Maps API V2 - Can't see module folder

I'm trying to integrate google maps API v2 into my project.
My build dependency is:
dependencies {
compile 'com.android.support:support-v4:13.0.0'
compile 'com.google.android.gms:play-services:4.0.30'
}
I've downloaded the android google play services and the google repository.
However, when i actually try to import the maps module the only directory that's displayed is:
import com.google.android.gms.R;
What's the reason for this? How can i import import com.google.android.gms.maps?
First make sure the versions for support and google play services you are using are available in your Android SDK under directory
For Support
$SDK_DIR\extras\android\m2repository\com\android\support\support-v4
For Google Play Services
$SDK_DIR\extras\google\m2repository\com\google\android\gms\play-services
In case you are using Android Studio 0.4.2 do upgrade it to 0.4.3 because there were some dependency related issues in 0.4.2.

Categories

Resources