Sign In Register

How can we help you today?

Start a new topic

Black screen with "Gamespark Preview Mode" text


I have been developing a game and decided to use GameSpark services.

Firstly I am using LibGDX framework with Java language for my game and used your android tutorial for connecting to server.


public class AndroidLauncher extends AndroidApplication {
    protected void onCreate(Bundle savedInstanceState) {
        AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();

GSAndroidPlatform.initialise(this, "Api_Key", "Api_Secret", "Credential_Secret", false, true);
initialize(new GameInstance(,config);

        initialize(new MyGame(, config);


I added the code at the upper side to my AndroidLauncher and send an instance of GS class to my game's main class. After that I tried to connect with an example user;


    public MyGame(GS gs) {        
                .send(new GSEventConsumer<AuthenticationResponse>() {
                    public void onEvent(AuthenticationResponse response) {
                        if (!response.hasErrors()) {
                            String authToken = response.getAuthToken();
                            String displayName = response.getDisplayName();
                            Boolean newPlayer = response.getNewPlayer();
                            GSData scriptData = response.getScriptData();
                            Player switchSummary = response.getSwitchSummary();
                            String userId = response.getUserId();
                            toast = toastFactory.create("Connection Succesful", Toast.Length.LONG);

I have also added internet connection permissions to Android Manifest


    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

 But after all that I faced black screen wtih "GameSpark Preview Mode" watermark. 


At the same time the error ,which at the below, was writing at console

I/System.out: GSConnection. gs.currentUrl: wss://

W/System.err: The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: HTTP/1.1 403 INVALID CREDENTIAL TYPE

W/System.err: at

W/System.err: at

W/System.err: at

W/System.err: at

W/System.err: at

W/System.err: at com.gamesparks.sdk.GSConnection.<init>(

W/System.err: at com.gamesparks.sdk.GS.NewConnection(

W/System.err: at com.gamesparks.sdk.GS.ConnectIfRequired(

W/System.err: at com.gamesparks.sdk.GS.processQueues(

W/System.err: at com.gamesparks.sdk.GS$

W/System.err: at

I have googled but cannot find anything useful. Please help me

1 Comment

I could not find any solution yet. Please help

Login to post a comment