problem with missing resources using Google Play Services

IvanToledoIvanToledo CLUniversity ✭✭

Hi, I'm using Google Play Services for Maps & Admob.

The app runs fine when the device has the latest Google Play Services version. It always complains about missing resources on the debug log, but works fine. I'm using the Gingerbread version.

The problem starts with older versions of Play Services installed. There's a utility method to check for wrong versions, and it provides a dialog to ask for the user to download the latest version. The problem is that creating the dialog fails, I think because of the missing resources.

It crashes on this line:

GooglePlayServicesUtil.GetErrorDialog(resultCode, this, 0)

with an Unhandled Exception.

The logs are like this:

01-28 19:26:38.538 W/dalvikvm(22460): VFY: unable to resolve static field 4552 (common_google_play_services_invalid_account_text) in Lcom/google/android/gms/R$string;
01-28 19:26:38.538 D/dalvikvm(22460): VFY: replacing opcode 0x60 at 0x0074
01-28 19:26:38.538 W/dalvikvm(22460): VFY: unable to resolve static field 4557 (common_google_play_services_unsupported_date_text) in Lcom/google/android/gms/R$string;
01-28 19:26:38.538 D/dalvikvm(22460): VFY: replacing opcode 0x60 at 0x007b
01-28 19:26:38.548 W/dalvikvm(22460): VFY: unable to resolve static field 4556 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-28 19:26:38.548 D/dalvikvm(22460): VFY: replacing opcode 0x60 at 0x000c
01-28 19:26:38.558 E/GooglePlayServicesUtil(22460): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
01-28 19:26:38.568 W/GooglePlayServicesUtil(22460): Google Play services out of date.  Requires 4030500 but found 3027105
01-28 19:26:39.488 W/AntenasActivity(22460): resultCode: 2

Any hints? Thanks :)

Posts

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    This line is the culprit:

    01-28 19:26:38.568 W/GooglePlayServicesUtil(22460): Google Play services out of date.  Requires 4030500 but found 3027105
    

    I'm going to guess that you're running this on the emulator?

  • IvanToledoIvanToledo CLUniversity ✭✭

    Nope, real device with an outdated Google Play Services. The problem is that many devices aren't updated and they crash instead of showing the update dialog.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    At this point all I can suggest is that you manually update Google Play Services on the device. You should be able to do so via the Play app.

  • IvanToledoIvanToledo CLUniversity ✭✭

    Tom: that's what I want to do, the Google supported way (GooglePlayServicesUtil.GetErrorDialog). Of course I can update services manually, but at least I want to guide the users.

    Why aren't the resources included? Is it a bug in Xamarin, the Google Play Services component, or am I doing something wrong?

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    My guess is that this is an issue with the component. Why those resources aren't include isn't something I can answer. Might be best to log a bug at http://bugzilla.xamarin.com.

    You could try creating your own binding to the component. I have see GooglePlayServicesUtil.GetErrorDialog working that way. The caveat is that manually binding Google Play Services can be an unhappy experience.

  • IvanToledoIvanToledo CLUniversity ✭✭

    Tom: Thanks for your suggestions, I already found a very similar bug:
    https://bugzilla.xamarin.com/show_bug.cgi?id=15129
    But no improvements since november.

    Will try to create my own binding, if I can make it work will document it on my blog.

  • IvanToledoIvanToledo CLUniversity ✭✭

    The Google Play Services component (without compatibility for Froyo or Gingerbread) works fine! It shows the dialog and redirects to the Play Store for updating.
    So it's a problem with the compatibility components for older versions.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    Birdie: thanks for narrowing it down.

Sign In or Register to comment.