android


Google maps suddenly not working


All of a sudden maps stopped working in my app and just shows a blank screen with the google logo in the bottom left corner.
The error I get is:
I/Google Maps Android API﹕ Google Play services package version: 4452038
I/ActivityManager﹕ Start proc com.google.android.gms.maps for service com.google.android.gms/.maps.auth.ApiTokenService:
I/Google Maps Android API﹕ Google Play services client version: 4452000
I/Google Maps Android API﹕ Failed to contact Google servers. Another attempt will be made when connectivity is established.
E/Google Maps Android API﹕ Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
The only think I believe is possible is an authentication error. Since I've tried on different networks and have not troubles there.
Could the problem be with the build.gradle file? Because the problems started after I messed around there, i think.
This is my build gradle:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
def versionPropsFile = file('version.properties')
if (versionPropsFile.canRead()) {
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
def value = 0
def runTasks = gradle.startParameter.taskNames
if ('assemble' in runTasks || 'assembleRelease' in runTasks || 'aR' in runTasks) {
value = 1;
}
def versionMajor = 1
def versionMinor = 3
def versionPatch = versionProps['VERSION_PATCH'].toInteger() + value
def versionBuild = versionProps['VERSION_BUILD'].toInteger() + 1
def version_Code = versionProps['VERSION_CODE'].toInteger() + value
versionProps['VERSION_PATCH'] = versionPatch.toString()
versionProps['VERSION_BUILD'] = versionBuild.toString()
versionProps['VERSION_CODE'] = version_Code.toString()
versionProps.store(versionPropsFile.newWriter(), null)
defaultConfig {
versionCode version_Code
versionName "${versionMajor}.${versionMinor}.${versionPatch} (${versionBuild})"
minSdkVersion 14
targetSdkVersion 19
}
} else {
throw new GradleException("Could not read version.properties!")
}
signingConfigs {
debug {
storeFile file("xxx.keystore")
storePassword "xxxx"
keyAlias "debug"
keyPassword "xxxx"
}
releaseKey {
storeFile file("xxx.keystore")
storePassword "xxxx"
keyAlias "release"
keyPassword "xxxx"
}
}
buildTypes {
debug {
debuggable true
packageNameSuffix ".debug"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.debug
}
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.releaseKey
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile project(':nineOldAndroids')
compile project(':expListViewLib')
compile project(':datetimepickerlibrary')
compile project(':volley')
compile 'com.android.support:support-v4:+'
compile 'com.google.android.gms:play-services:+'
compile files('libs/aws-android-sdk-1.7.1.1.jar')
compile files('libs/disklrucache-2.0.1.jar')
}
the manifest looks like the following:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app" >
<permission
android:name="com.example.app.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="com.example.app.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
...
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="#string/config_com.google.android.maps.v2.api_key" />
</application>
</manifest>
I have checked multiple times that packageName, sha1 fingerprint and API is correct. All of them are, but I still get an empty map.
I've seen similar questions out there but none of the solutions I found. It just refuses to work for me.
Any suggestions?
EDIT:
Nothing that I have tried works. But I did find a similar question with someone who seems to have the same problem: Google Maps Android API Authorization failure - has this service changed in the last few months?
I had exactly the same problem and the solution was not obvious at all. Check if you are not changing DefaultSSLSocketFactory with:
HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
Removing this line and setting socket factory just for the required connection made my maps work.

Related Links

TouchImageView - Is image scaled?
Android: Override own XML View in XML
Signing for Direct Distribution
Android: Localized standard Text for example OK, CANCEL and GPS not activated - for example?
draw arrow between two listview
Embedded YouTube video in WebView does not respect full screen settings
LIstview position in android
Why do I need to specify the XML namespace when using getAttributeResourceValue?
java.net.SocketException: Permission denied for android
How to change default sms application background in android
List View not reloaded
Calling Multiple Activity classes in a single screen?
Get Android PRL Version
set new content view after running thread
What is the difference between ArrayAdapter , BaseAdapter and ListAdapter
Open an app by clicking on an URL in android

Categories

HOME
shell
cygwin
gridview
adal
merge
webdriver
css3
jax-rs
solaris
devise
pdfbox
xbee
tvos
gluon-mobile
nfs
title
character
computer-science
fabric.io
windows-ce
selectize.js
keytool
symfony-2.8
microsoft-dynamics-nav
red5
easyphp
nim
connector
gmm
event-store
shared
8051
soot
postback
contacts
reverse
arduino-ide
imx6
magento-1.9.2.4
alphabetical
imagenet
google-earth-engine
gdata
demo
google-data-api
naming
plr
bindingnavigator
placeholder
oim
rfc3339
jboss-4.2.x
hadoop-2.7.2
pacemaker
adafruit
spring-cloud-feign
dup
delta
respondcms
refinerycms
cda
yajsw
nio2
grass
concept-insights
spring-retry
morton-number
phonertc
canalyzer
finalbuilder
typemock
baasbox
dnssec
webmatrix-3
viewer
crowd
post-commit-hook
sql-scripts
imagefilter
tweenlite
dct
paste
android-framework
dsym
syndicationfeed
solace-mq
robotlegs
sentestingkit
adobe-media-server
thttpd
mapping-by-code
window-decoration
relative
entity-attribute-value
cgbitmapcontextcreate
svk
silent
asynchronous-wcf-call
sifr3
information-management
appliance
great-circle

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App