NoSuchMethodError com.google.android.gms.internal.g.f

前端 未结 1 1309
北海茫月
北海茫月 2021-01-02 10:30

I have a difficult problem to solve. I\'ve published my app on Play and everything is okay, but the problem is that there are 2 devices that crashes the app with the followi

相关标签:
1条回答
  • 2021-01-02 10:48

    The first line on the stracktrace give you a clue:

    java.lang.NoSuchMethodError: java.io.IOException.<init>
    

    Basically it's saying that some constructor for IOException is missing. Looking at the javadocs, there are two constructors that were added in API level 9:

    public IOException (Throwable cause)
    public IOException (String message, Throwable cause)
    

    That should answer your question. API level 9 is Android 2.3. Hence, the stack trace is from a device running Android 2.2 or below, which is missing the two constructors above.

    There are at least two solutions to solve the problem:

    • Change the minSdkVersion in your app's manifest to 9.
    • Don't use the latest Google Play Services library, but use the Froyo version in stead.

    The latter you can find in the SDK Manager. It was added with the last update because support for Froyo (Android 2.2) was dropped. Quote from the linked blog post:

    With over 97% of devices now running Android 2.3 (Gingerbread) or newer platform versions, we’re dropping support for Froyo from this release of the Google Play services SDK in order to make it possible to offer more powerful APIs in the future. That means you will not be able to utilize these new APIs on devices running Android 2.2 (Froyo).

    0 讨论(0)
提交回复
热议问题