Google Maps API V2 - Can't see module folder - android

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.

Related

Android Implementing Google Places Error

I am trying to implement Google Places on my Android App. I already have Google Maps working and I have enabled the Places SDK for Android API to the project but it still does not recognize any of the Places's classes.
import com.google.android.gms.location.places.AutocompleteFilter;
import com.google.android.gms.location.places.AutocompletePrediction;
import com.google.android.gms.location.places.AutocompletePredictionBufferResponse;
import com.google.android.gms.location.places.GeoDataClient;
The project does not recognize these imports.
The Place Picker is deprecated as of January 29, 2019. This feature will be turned off on July 29, 2019, and will no longer be available after that date. To continue using the Place Picker through the deprecation period, do NOT disable the Places SDK for Android in your Google Cloud Platform project, as doing so will also disable the Place Picker.
https://developers.google.com/places/android-sdk/client-migration#compat
Maps != Places != Routes
You probably don't have the dependency yet on the build file. However, due to Google's recent Maps monetization policy, you will have to setup a billing account. Go here: https://cloud.google.com/maps-platform and complete the mini wizard. It will do additional setup on your projects and will probably (I didn't go through it yet) give you the exact implementation sentence you need to declare.
The GeoDataClient and AutocompletePredictionBufferResponse classes were added in Google Play Services 11.2.0.
So, make sure that you're using at least version 11.2.0 of Google Play Services:
dependencies {
compile 'com.google.android.gms:play-services-maps:11.2.0'
compile 'com.google.android.gms:play-services-location:11.2.0'
compile 'com.google.android.gms:play-services-places:11.2.0'
//.....
}

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

Can't Import gms Location Place

After I Updated gms:play-services-location from 9.0.2 to 9.6.1, I couldn't import com.google.android.gms.location.places.Place and I couldn't use PlaceAutoComplete either.
Was it deprecated or removed from google play service location?
Per the list of split dependencies, to include the places APIs, you must include the dependency
compile 'com.google.android.gms:play-services-places:9.6.1'
The places dependency was only added in Google Play services 9.2.0 - before that, it was part of the maps dependency, which was a requirement for location (version 9.6.0 also removed the dependency of location on maps), hence why previously when you included location you also got places.
add this version in your gradle
compile 'com.google.android.gms:play-services:7.3.0'

Android Google Map : Error in android google map

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'
}

Google play services maps 9.2.0 issue

My Android app has been successfully using maps by including the following in my gradle ...
compile project(':googleplayservices_lib')
My SDK manager says I have rev 32 which appears to be the latest. So with this, everything has been working just fine.
Now I'm enhancing the app and I saw some posts that says I can now use zIndex parameter when adding a marker to control the Z Index. But to do this I must add the following to my gradle . . .
compile 'com.google.android.gms:play-services-maps:9.2.0'
So now my gradle file has this dependencies section . . .
dependencies {
compile project(':library')
compile project(':googleplayservices_lib')
compile files('libs/gson-2.2.4.jar')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:design:22.2.1'
compile 'com.google.android.gms:play-services-maps:9.2.0'
}
Now I'm able to set zIndex but this new version apparently comes with breaking changes. For instance the following no longer works . . .
map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
map is a GoogleMap. The compiler cannot resolve the getMap() method. My problem is that I can't seem to locate the documentation on this new maps revision where it discusses breaking changes for this new version. Does anyone know where I can find such information?
My Android app has been successfully using maps by including the following in my gradle
Presumably, that is an in-project copy of the old Eclipse library project edition of the Play Services SDK. Ideally, you would have moved off of that to the Play Services SDK artifacts back when you moved to Android Studio.
My SDK manager says I have rev 32 which appears to be the latest
Since you are using a local in-project copy, what the SDK Manager reports is not directly relevant.
Also, Google has not been maintaining that library project for at least the past several months, so "latest" of that library is meaningless with respect to using the latest version of the Play Services SDK.
So now my gradle file has this dependencies section . . .
I am surprised that compiles. Remove compile project(':googleplayservices_lib'). If you are using parts of the Play Services SDK beyond Maps V2, use appropriate and compatible artifacts for those APIs as well.
The compiler cannot resolve the getMap() method.
getMap() was deprecated about 20 months ago, in favor of getMapAsync().
My problem is that I can't seem to locate the documentation on this new maps revision where it discusses breaking changes for this new version.
Maps V2 release notes are in the Play Services documentation. A subset of Maps V2 release notes are incorporated in the overall Play Services release notes.

Categories

Resources