-1

I update the Google play service SDK (Rev 29) in Android SDK Manager recently. Then I found the apk I build after the SDK is updated will crash during initial the GoogleApiClient.

Here is the code we use.

mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(this)
                .addOnConnectionFailedListener(this)
                .addApi(LocationServices.API)
                .build();

And here is the log of call stack

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xxxxxxx.xxxxx, PID: 3855
java.lang.VerifyError: Rejecting class com.google.android.gms.location.internal.zzd because it failed compile-time verification (declaration of 'com.google.android.gms.location.internal.zzd' appears in /data/app/com.xxxxxx.xxxx-2/base.apk) at com.google.android.gms.location.LocationServices.(Unknown Source)

The google play service version I use is com.google.android.gms:play-services-location:8.3.0

hawa11
  • 481
  • 5
  • 5

1 Answers1

1

I try to update Location service to 8.4.0.
But it cause Version conflict updating to 8.4.0.
So I follow the instruction in the above link.
Then the problem solved.

Here is the instruction I use.

  1. change to use compile 'com.google.android.gms:play-services-location:8.3.0' in app build.gradle
  2. move apply plugin: 'com.google.gms.google-services' to the end of app build.gradle
  3. use classpath 'com.google.gms:google-services:2.0.0-alpha3' in project build.gradle dependency
  4. change to use gradle-2.8 in gradle/wrapper/gradle-wrapper.properties
Community
  • 1
  • 1
hawa11
  • 481
  • 5
  • 5