googlesamples / android-play-safetynet

Samples for the Google SafetyNet Attestation API
Apache License 2.0
285 stars 133 forks source link

Crash on rotation when trying to build the GoogleApiClient #6

Closed sea-cat closed 7 years ago

sea-cat commented 7 years ago

stacktrace:

Caused by: java.lang.IllegalStateException: Already managing a GoogleApiClient with id 0 at com.google.android.gms.common.internal.zzaa.zza(Unknown Source) at com.google.android.gms.internal.zzqm.zza(Unknown Source) at com.google.android.gms.common.api.GoogleApiClient$Builder.zzf(Unknown Source) at com.google.android.gms.common.api.GoogleApiClient$Builder.build(Unknown Source) at com.example.android.safetynetsample.SafetyNetSampleFragment.buildGoogleApiClient(SafetyNetSampleFragment.java:165) at com.example.android.safetynetsample.SafetyNetSampleFragment.onCreate(SafetyNetSampleFragment.java:60)

jfschmakeit commented 7 years ago

Thanks for the report. This isn't an issue in the last update of the sample code anymore (we don't need a GoogleApiClient anymore).

Unfortunately we are still loosing some state on rotation, I'll take a look.

jfschmakeit commented 7 years ago

Fixed the orientation issue in https://github.com/googlesamples/android-play-safetynet/commit/e38ff00f011e0fcf0f95ad835fe6e8c03a6ce828 The app is now no longer loosing its SafetyNet result on rotation.