小编msz*_*zik的帖子

"您尚未指定要用作弹出窗口内容的视图"

所以我一直在尝试在我的游戏中实现排行榜/成就,并且没有任何实现,游戏运行得很好.我已经成功导入了google-play-services-lib并复制了BaseGameUtils.但每当我尝试为GameHelper对象调用setup时,它就会崩溃.LogCat给出以下错误:

getCSCPackageItemText() You have not specified a View to use as content view for popups. Falling back to the Activity content view which may not work properly in future versions of this API. Use setViewForPopups() to set content view. Shutting down VM.

稍微低一点,这个错误也给出了:

 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.packagename.AndroidLauncher}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
Run Code Online (Sandbox Code Playgroud)

然而,我在将GPGS与libGDX集成时看到的所有教程都没有使用这些函数.我已经尝试在我的主视图上实现setViewForPopups(我正在使用Mopub进行广告,因此我将两个视图放入布局中),但它似乎没有改变任何东西.这是我的onCreate方法似乎导致崩溃的部分:

   super.onCreate(savedInstanceState);
   gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
   gameHelper.enableDebugLog(false);
   GameHelperListener gameHelperListener = new GameHelper.GameHelperListener() {
        @Override
        public void onSignInSucceeded() {
        }

        @Override
        public void …
Run Code Online (Sandbox Code Playgroud)

android gradle libgdx google-play-services

6
推荐指数
1
解决办法
3052
查看次数

标签 统计

android ×1

google-play-services ×1

gradle ×1

libgdx ×1