Android – Google Play游戏服务,找不到方法android.view.View.getDisplay

登录弹出窗口没有显示出来. logcat说

  Could not find method android.view.View.getDisplay, referenced from method com.google.android.gms.internal.bn$b.b
   VFY: unable to resolve virtual method 3169: Landroid/view/View;.getDisplay ()Landroid/view/Display;
   VFY: replacing opcode 0x6e at 0x0009

我只测试了真正的设备,三星S3,它是Android 4.1.2(API 16). getDisplay()方法需要API 17.我尝试了“扩展FragmentActivity”,但support-v4库中没有getDisplay(). GamesClient.Builder.setViewForPopups()要么没有帮助.
谷歌游戏服务应该支持自Android 2.2以来的要求.

我所有的开发工具都是最新的. google-play-lib 3.1.59(744626-30),SDK 22.0.4.

非常感谢你.

最佳答案 请尝试以下步骤:

  1. Right click the project, and choose Properties
  2. Go to Java Build Path-Order and Export.
  3. Tick ‘Android Private Libraries’ if you put your libs there or tick on your libs.

然后清洁和建立.

点赞