Me and my team have a problem on google maps in Android Studio. The maps showed is able to zooming up to a certain point. After maps remains pixelated (zooming up maps does not loading). We have tested in many devices, in a tablet for example some maps regions are not exactly showed: there are many gray squares.
The same code for the maps that working in another project, imported in our project has this strange behavior (We have tested both in wifi and cellular data network).
We are followed step by step google develeoper guide.
We have this configuration:
android studio 1.1.0
min sdk 16
target sdk 21
Gradle conf:
compile 'com.google.android.gms:play-services-maps:7.5.0'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
This is a screenshot of my situation: http://oi59.tinypic.com/vra3o2.jpg
I have resolved. The problem was in gradle. I'm using aviary and its dependecy from okhttp blocked google maps loading.
This are line added under dependencies:
compile('com.adobe.creativesdk:image:4.0.0') {
exclude group: "com.squareup.okhttp"
}
...
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
Related
i want to add google mobile vision library by add this line to build.gradle :
compile 'com.google.android.gms:play-services-vision:11.6.0'
but android studio error!
what's wrong?
Try using different lib version. This works perfectly for me
compile 'com.google.android.gms:play-services-vision:9.4.0+'
I use google map in project, but it is dont work rightly. I have registred Google map Api Key in google services and add in my project AndroidManifest.xml
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value=" Api key" />
But it is don't show map you can see it in this picture:
When i run my app, in tab Anroid Monitor of Android Studio i have this error:
I can't find resolve.
and in Api monitor i have this error too, when i open app
java.io.IOException: Server returned: 3
Did you added play-services dependency in gradle file?
If Possible change your play-service dependency and set dependency based on building tools installed or api installed, like following way
From
compile 'com.google.android.gms:play-services-maps:10.0.1'
To
compile 'com.google.android.gms:play-services-maps:10.2.1'
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.
In my app I have added Google Maps and they work fine. I want to add a PlaceAutocompleteFragment. I am using the key which I had already generate for maps and I have enable the option Places Api from google.console. I have added these to my build.gradle:
compile 'com.google.android.gms:play-services-maps:8.3.0'
compile 'com.google.android.gms:play-services-location:8.3.0'
compile 'com.google.android.gms:play-services:8.3.0'
but when I try to use PlacesAutoCompleteFragment then Android Studio can't resolve this.
The problem here is that PlaceAutocompleteFragment didn't exist in version 8.3 of Google Play Services.
This isn't documented very well, but you can see on this blog that PlaceAutocompleteFragment was "announced" in December 2015.
You can also see in the PlaceCompleteFragment Google code samples on GitHub that they are using version 8.4 of GooglePlayServices.
I also had this problem, and updating Google Play Services is what made it work.
So, update Google Play Services in the SDK Manager, and then modify the build.gradle like so, and it should work:
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
Update
In newer versions of Google Play Services, they have broken out the Google Places API, so you need to include it in addition to Maps and Location:
compile 'com.google.android.gms:play-services-maps:11.0.2'
compile 'com.google.android.gms:play-services-location:11.0.2'
compile 'com.google.android.gms:play-services-places:11.0.2'
I'm currently having an issue in my Android project based on Gradle. My project has two dependencies:
compile project(':Library:lib1')
compile files('libs/libGoogleAnalyticsServices.jar')
libGoogleAnalyticsServices is version v3 for google analytics.
the problem is that lib1 is an old library depending on version v2 of google analytics:
compile files('libs/libGoogleAnalyticsV2.jar')
At the end there's a conflict between both jars (even if v2 should be only visible by lib1) and v2 is taking over v3. In my main module I'm having missing references.
So two problems:
Why is v2 even visible from the main module?
Why is v2 taking over v3?
Ideally I'd like to keep v2 only visible from my lib1 and v3 only visible from my main module.
Any idea?
I don't know much about Android, but I would assume that the situation is the same as for standard Java applications: You can only use one version of a particular library per application, and have to make sure that all code that ships with your application is compatible with that version.