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

戏子无情 提交于 2019-11-30 13:45:38

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).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!