After Upgrading to Google Play Services 9.0.0, App Hangs in Dynamitemodulesc

After Upgrading to Google Play Services 9.0.0, App Hangs in DynamiteModulesC

The background_crash process is created by Firebase Crash Reporting. That's why you're seeing the duplicate messages, but I don't think its the root cause here. I'm going to file the hang as an issue upstream with the Google Play services team, but there is probably a workaround you can use in the mean time:

Because you're specifying com.google.android.gms:play-services:9.0.0 as a dependency you're bringing in literally all of Google Play services - which is a lot!

I would recommend replacing that line with the specific dependencies you need. You can find a full list here. As an example, if you're using Maps and Google Sign In, you might specify:

compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-maps:9.0.0'

App stops responding after resuming from background sometimes. Could Firebase be to blame?

I had the exact same problem and solved it by replacing the dependency com.google.android.gms:play-services:9.0.0 with the ones I actually used as described in the answer here https://stackoverflow.com/a/37379662/4134617

My build.gradle ended up like this.

    dependencies {
compile project(':BaseGameUtils')
compile "com.google.android.gms:play-services-games:9.0.0"
compile "com.google.android.gms:play-services-plus:9.0.0"
compile "com.google.android.gms:play-services-ads:9.0.0"
compile 'com.google.firebase:firebase-core:9.0.0'
}

ANR caused by com.google.android.gms.DynamiteModules

I had the exact same ANR as you using Firebase and Google Play Services. I solved my problem with the answer in After Upgrading to Google Play Services 9.0.0, App Hangs in DynamiteModulesC -- remove the general play-services and only include the specific play service libraries you need.

New Firebase Initialize Crashes

Are you calling FirebaseRemoteConfig in an Application subclass? You may be hitting the issue where the background_crash also instantiates an app subclass, and therefore executes your code on a process where the FirebaseApp isn't set up. If you look at the full stack trace you should be able to see what process it occurred on near the top.

FirebaseApp is normally configured by a ContentProvider automatically merged in to your manifest by the Firebase SDK. Initializing Firebase Remote Config causes it to try and read from its local cache, which involves getting the app ID value from FirebaseApp. If you want to guard against uninitialized errors, then you can either move your code to an Activity, or check whether you have a FirebaseApp instance before calling the RemoteConfig code in your Application subclass:

@Override
public void onCreate() {
super.onCreate();
if (!FirebaseApp.getApps(this).isEmpty()) {
FirebaseRemoteConfig mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();

}
}

If its not that, check you aren't getting any errors from the google-services plugin at build time.

Smooth GCM to FCM transition

Importing your Google project into Firebase is a one way operation, however this is not a destructive operation, your current project will have required APIs turned on and necessary API keys will be generated for use with Firebase, but you can still manage that project from the Google Developer console if you decide not to continue using Firebase.

Your present server solutions will continue to work as before. I would go with importing your project to Firebase. It will be much easier than having to migrate your backend to a new project.

note:

  • If you were using pre InstanceID tokens for device IDs then they will not work in the Firebase console or with topics. So you would have to maintain a mapping of which users you can send to using the Firebase console and/or topics. If your were using GCM with InstanceID then there is nothing to do since FCM also uses InstanceID. You can use the FCM REST API to send to ALL tokens, InstanceID or pre InstanceID.
  • Be sure not to use GCM and FCM libs in the same client app. You can find issues when generating tokens and handling received messages.

Google Play Achievements IOException: Address already in use

Just a shot in the dark, but it might be the first step in solving some of the issues...

In your gradle build file you are requesting inclusion of all of Google Play Services:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':BaseGameUtils')
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.google.android.gms:play-services:9.2.0' <-- NOT GOOD
compile 'com.google.firebase:firebase-ads:9.0.0'
compile 'com.google.android.gms:play-services-ads:9.2.0'
compile 'com.google.android.gms:play-services-auth:9.2.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'
}

This pulls in many capabilities that you probably are not using and do not need. You get all the Play Services and Firebase libraries. In particular, you get the new Firebase Crash Reporting, which is still in Beta. I see entries in some of your stack traces which contain the tag background_crash which is one of the Crash Reporting components.

Many people (myself included) have had problems with app hangs caused by pulling in all of PlayServices/Firebase. See this related issue.

As a starting point, I'd recommend editing your dependencies to remove play-services:9.2.0 and then retain or add only the specific libraries needed to get your app to build successfully. It probably won't fix all the crashes, but may help. Plus, I think you'll find your app builds faster and produces a smaller APK.

Update

One of your crash call stacks is similar to the one in this related issue. That crash was caused by not having the metadata for APP_ID defined. I don't the meta data defined in your manifest. Don't you need it? Adding it is one of the steps in this guide for using Games Services.

Update 2

I confirmed the problem is the missing metadata for APP_ID. You had it at one time in your AndroidManifest file but there was a typo. You had an extra 'o' in google:

com.gooogle.android.gms.games.APP_ID

Uncomment the metadata in the manifest and correct the typo. The app should then run without crashing. It did for me.

<application
android:allowBackup="true"
android:icon="@mipmap/icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/NoActionBar">
<meta-data
android:name="com.google.android.gms.games.APP_ID" <-- typo was here
android:value="@string/app_id"/>

If it still crashes, look at the unfiltered logcat output. To do that select No Filters in the Android Monitor window.. If there is still a problem with the APP_ID metadata, you will see this message:

 E/ValidateServiceOp: Using Google Play games services requires a metadata tag with the name "com.google.android.gms.games.APP_ID" in the application tag of the manifest for com.gfaiers.hangman

You might also want to do further cleanup of your build dependencies:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':BaseGameUtils')
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.google.firebase:firebase-ads:9.2.0'
//compile 'com.google.android.gms:play-services-ads:9.2.0'
//compile 'com.google.android.gms:play-services-auth:9.2.0'
//compile 'com.google.android.gms:play-services-gcm:9.2.0'
compile 'com.google.android.gms:play-services-games:9.2.0'
}


Related Topics



Leave a reply



Submit