A trivial but annoying issue has come up in the last few days. Previously my menu option which popped up a dialog to show the legal text for using Google Services was very full (if a little slow to load), but now it is null with no change to the code..
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
if (resultCode == ConnectionResult.SUCCESS) {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("About");
builder.setMessage(apiAvailability.getOpenSourceSoftwareLicenseInfo(this));
builder.setPositiveButton("OK", null);
builder.show();
}
Is this a problem common to others, i.e. a new bug introduced by a Google update or some other possibility?
according to https://code.google.com/p/gmaps-api-issues/issues/detail?id=9813
It appears that google changed the file name it was looking for from
oss_notice
tothird_party_licenses
. They basically broke getting the license info for any play services implementation below 9.0.0.
you will need to update the version to 9.0.0 to get the license info back for device with later versions of play services.
EDIT (June 6, 2016): Google is looking into the issue now.
Project Member #3 [email protected]
Thanks for the reports. We've filed this internally and will look into it.
Status: Accepted Labels: Internal-29143355
Yes, upgrading Google Play Services to last version (9.0.0 at time of writing this answer) solves the issue.
I had the same problem and after upgrading Google Play Services I started getting the licenses properly.
If you're maintaining an old app and can't reasonably update from a very old version of Google Play Services without breaking a whole lot of ancient features, there's a viable workaround:
Decompile the getOpenSourceSoftwareLicenseInfo() method with Android Studio, copy the method into your project, and change the line to point from "oss_notice" to "third_party_licenses".
Uri var1 = (new android.net.Uri.Builder()).scheme("android.resource").authority("com.google.android.gms").appendPath("raw").appendPath("oss_notice").build();
to
Uri var1 = (new android.net.Uri.Builder()).scheme("android.resource").authority("com.google.android.gms").appendPath("raw").appendPath("third_party_licenses").build();
This method has been deprecated and is no longer necessary: https://developers.google.com/android/reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getOpenSourceSoftwareLicenseInfo(android.content.Context)
This license information is displayed in Settings > Google > Open Source on any device running Google Play services. Applications do not need to display this license text, and this method will be removed in a future version of Google Play services.
👍
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With