getOpenSourceSoftwareLicenseInfo is returning null now

前端 未结 4 595
北恋
北恋 2021-02-15 00:45

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

相关标签:
4条回答
  • 2021-02-15 01:15

    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 to third_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 l...@google.com

    Thanks for the reports. We've filed this internally and will look into it.

    Status: Accepted Labels: Internal-29143355

    0 讨论(0)
  • 2021-02-15 01:20

    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.

    0 讨论(0)
  • 2021-02-15 01:34

    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.

    0 讨论(0)
  • 2021-02-15 01:34

    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();
    
    0 讨论(0)
提交回复
热议问题