My flutter android application seems to quit soon after loading with following error message. I am using google maps in my application and this happens soon after the maps load. I can see the map but can't seem to press +/- zoom button on the map. So, I am not sure if the map is loading completely with success. But because I see the map, I believe API keys are set up correctly. I have spent days trying to figure this out. So, any help appreciated. Following is error message and configuration file for my project.
[+4906 ms] W/GmsClient(30295): IGmsServiceBroker.getService failed
[ ] W/GmsClient(30295): android.os.DeadObjectException
[ ] W/GmsClient(30295): at android.os.BinderProxy.transactNative(Native Method)
[ ] W/GmsClient(30295): at android.os.BinderProxy.transact(Binder.java:1127)
[ ] W/GmsClient(30295): at com.google.android.gms.common.internal.IGmsServiceBroker$Stub$zza.getService(com.google.android.gms:[email protected]@17.2.1:13)
[ ] W/GmsClient(30295): at com.google.android.gms.common.internal.BaseGmsClient.getRemoteService(com.google.android.gms:[email protected]@17.2.1:257)
[ ] W/GmsClient(30295): at com.google.android.gms.common.api.internal.zabn.run(com.google.android.gms:[email protected]@17.2.1:11)
[ ] W/GmsClient(30295): at android.os.Handler.handleCallback(Handler.java:873)
[ ] W/GmsClient(30295): at android.os.Handler.dispatchMessage(Handler.java:99)
[ ] W/GmsClient(30295): at com.google.android.gms.internal.base.zap.dispatchMessage(com.google.android.gms:[email protected]@17.2.1:8)
[ ] W/GmsClient(30295): at android.os.Looper.loop(Looper.java:193)
[ ] W/GmsClient(30295): at android.os.HandlerThread.run(HandlerThread.java:65)
App level build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.fair.riderapp"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//-> implementation 'com.google.firebase:firebase-core:16.0.1'
// Add the SDK for Firebase Cloud Messaging
//-> implementation 'com.google.firebase:firebase-messaging:17.0.3'
//implementation 'com.google.firebase:firebase-analytics:17.4.4'
implementation 'com.google.firebase:firebase-auth:19.3.2'
//implementation 'com.android.support:support-core-utils:28.0.0'
// <-
//implementation 'com.google.firebase:firebase-analytics:17.4.4'
implementation 'com.google.firebase:firebase-messaging:20.2.3'
}
apply plugin: 'com.google.gms.google-services'
//apply plugin: 'com.android.application'
Project level build graddle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
//->classpath 'com.android.tools.build:gradle:3.3.0'
//->classpath 'com.google.gms:google-services:4.0.1'
//classpath 'com.google.gms:google-services:4.3.3'
//<-
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
if (details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx') ) {
details.useVersion "1.0.1"
}
if (details.requested.group == 'androidx.localbroadcastmanager' &&
!details.requested.name.contains('androidx')) {
details.useVersion "1.0.0"
}
}
}
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
project level gradle.properties
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
My pubspec.yaml
name: abc_xyz_app
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cloud_firestore: ^0.13.7 #any
firebase_auth: ^0.16.1 #^0.8.4+5
google_maps_flutter: ^0.5.28+1 #any
flutter_map: ^0.10.1 #any
# geoflutterfire: ^2.0.3+2
location: ^3.0.2 #^2.3.5
google_maps_webservice: ^0.0.17 #^0.0.14
http: ^0.12.2 #^0.12.0+2
uuid: ^2.2.0 #^2.0.1
geolocator: ^5.3.2+2 #^5.1.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
provider: ^4.3.1 #^3.0.0+1
geocoder: ^0.2.1 #^0.1.2
flutter_google_places: ^0.2.4 #^0.2.3
geoflutterfire: ^2.1.0 #any
get_it: ^4.0.2 #^1.0.3+2
shared_preferences: ^0.5.8 #^0.5.3+4
flutter_spinkit: ^4.1.2+1 #^4.0.0
firebase_messaging: ^6.0.16 #^4.0.0+1
flutter_mapbox_autocomplete: ^1.0.4 #^1.0.3
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3 #^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- assets/FAYR_logo.png
- assets/greencar.png
- assets/loading.gif
Solution 1: Vincent Mwagiru
I have the same problem. Started today. service was working just fine. Could it be an update on gooogl services
Google Maps Android API(12315): Google Play services package version: 202414019 D/AbsListView(12315): Get MotionRecognitionManager W/GmsClient(12315): IGmsServiceBroker.getService failed W/GmsClient(12315): android.os.DeadObjectException