找到你要的答案

Q:Error when trying to open PlayScape Exchange catalog on Android

Q:当试图在Android开放的游乐器械交换目录错误

I'm trying to implement the PlayScape SDK into GameMaker: Studio. I've followed the native Android integration guide and, after some work, got it to build without errors. However, I am getting an error message when I try to open the Playscape Exchange catalog and I'm not sure what it means.

I'm currently using the following code:

package ${YYAndroidPackageName};

import ${YYAndroidPackageName}.RunnerActivity;
import com.yoyogames.runner.RunnerJNILib;
//Some more general imports go here

import com.playscape.exchange.ExchangeManager;

public class GMPlayscape extends ExtensionBase
{
    public void showExchange()
    {
        RunnerActivity.ViewHandler.post( new Runnable()
        {
            public void run() 
            {
                ExchangeManager.getInstance().showCatalog();
            }
        });
    }
}

After calling showExchange() from my own code, I'm getting the following error:

E/AndroidRuntime(17482):  FATAL EXCEPTION: main
E/AndroidRuntime(17482):  Process: com.companyname.Playscape_For_Android, PID: 17482
E/AndroidRuntime(17482):  java.lang.NullPointerException: Attempt to invoke interface method 'void java.util.concurrent.ExecutorService.execute(java.lang.Runnable)' on a null object reference
E/AndroidRuntime(17482):   at com.playscape.exchange.ExchangeManager.showCatalog(ExchangeManager.java:99)
E/AndroidRuntime(17482):   at com.companyname.Playscape_For_Android.GMPlayscape$1.run(GMPlayscape.java:38)
E/AndroidRuntime(17482):   at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(17482):   at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(17482):   at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(17482):   at android.app.ActivityThread.main(ActivityThread.java:5343)
E/AndroidRuntime(17482):   at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17482):   at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(17482):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
E/AndroidRuntime(17482):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

After this, the application crashes. What am I doing wrong here?

我试图实施Playscape SDK游戏:工作室。我遵循了本地Android集成指南,并在一些工作,让它建立没有错误。然而,我得到一个错误消息当我尝试打开Playscape交换目录,我不知道这意味着什么。

我现在使用下面的代码:

package ${YYAndroidPackageName};

import ${YYAndroidPackageName}.RunnerActivity;
import com.yoyogames.runner.RunnerJNILib;
//Some more general imports go here

import com.playscape.exchange.ExchangeManager;

public class GMPlayscape extends ExtensionBase
{
    public void showExchange()
    {
        RunnerActivity.ViewHandler.post( new Runnable()
        {
            public void run() 
            {
                ExchangeManager.getInstance().showCatalog();
            }
        });
    }
}

从我自己的代码调用showexchange()之后,我得到了下面的错误:

E/AndroidRuntime(17482):  FATAL EXCEPTION: main
E/AndroidRuntime(17482):  Process: com.companyname.Playscape_For_Android, PID: 17482
E/AndroidRuntime(17482):  java.lang.NullPointerException: Attempt to invoke interface method 'void java.util.concurrent.ExecutorService.execute(java.lang.Runnable)' on a null object reference
E/AndroidRuntime(17482):   at com.playscape.exchange.ExchangeManager.showCatalog(ExchangeManager.java:99)
E/AndroidRuntime(17482):   at com.companyname.Playscape_For_Android.GMPlayscape$1.run(GMPlayscape.java:38)
E/AndroidRuntime(17482):   at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(17482):   at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(17482):   at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(17482):   at android.app.ActivityThread.main(ActivityThread.java:5343)
E/AndroidRuntime(17482):   at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17482):   at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(17482):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
E/AndroidRuntime(17482):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

在此之后,应用程序崩溃。我在这里做错什么了?

answer1: 回答1:

This issues was identified as a bug in the SDK. It was fixed with Playscape publishing kit 1.15.

这个问题被认定为在SDK的bug。它是固定的游乐器械出版套件1.15。

android  playscape