Java 将Google play服务安装到Libgdx游戏
当我试图将Google play服务添加到我的Libgdx游戏中时,我不知道从哪里开始 有什么帮助吗Java 将Google play服务安装到Libgdx游戏,java,android,libgdx,google-play-services,Java,Android,Libgdx,Google Play Services,当我试图将Google play服务添加到我的Libgdx游戏中时,我不知道从哪里开始 有什么帮助吗 06-08 00:04:29.626: I/System.out(3668): debugger has settled (1381) 06-08 00:04:29.774: D/dalvikvm(3668): Trying to load lib /data/app-lib/com.alnassre.ffeather.android-1/libgdx.so 0x41ef5348 06-08 0
06-08 00:04:29.626: I/System.out(3668): debugger has settled (1381)
06-08 00:04:29.774: D/dalvikvm(3668): Trying to load lib /data/app-lib/com.alnassre.ffeather.android-1/libgdx.so 0x41ef5348
06-08 00:04:29.782: D/dalvikvm(3668): Added shared lib /data/app-lib/com.alnassre.ffeather.android-1/libgdx.so 0x41ef5348
06-08 00:04:29.782: D/dalvikvm(3668): No JNI_OnLoad found in /data/app-lib/com.alnassre.ffeather.android-1/libgdx.so 0x41ef5348, skipping init
06-08 00:04:30.962: D/dalvikvm(3668): threadid=1: still suspended after undo (sc=1 dc=1)
06-08 00:04:31.532: D/GameHelper(3668): GameHelper: Debug log enabled.
06-08 00:04:32.227: D/GameHelper(3668): GameHelper: Setup: requested clients: 1
06-08 00:04:32.306: W/PopupManager(3668): You have not specified a View to use as content view for popups. Falling back to the Activity content view. Note that this may not work as expected in multi-screen environments
06-08 00:04:36.837: D/AndroidRuntime(3668): Shutting down VM
06-08 00:04:36.837: W/dalvikvm(3668): threadid=1: thread exiting with uncaught exception (group=0x41646700)
06-08 00:04:36.868: E/AndroidRuntime(3668): FATAL EXCEPTION: main
06-08 00:04:36.868: E/AndroidRuntime(3668): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.alnassre.ffeather.android/com.alnassre.ffeather.android.AndroidLauncher}: java.lang.NullPointerException
当我删除此.googleServices.sign()时代码>游戏正常开始
public class FFeather extends Game {
public IGoogleServices googleServices;
public FFeather(IGoogleServices googleServices)
{
super();
this.googleServices = googleServices;.
this.googleServices.signIn();
}
....
android的主要启动器:
public class AndroidLauncher extends AndroidApplication implements GameHelperListener,IGoogleServices {
private GameHelper _gameHelper;
private final static int REQUEST_CODE_UNUSED = 9202;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create the GameHelper.
_gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
_gameHelper.enableDebugLog(true);
GameHelperListener gameHelperListener = new GameHelper.GameHelperListener() {
@Override
public void onSignInSucceeded() {
Gdx.app.log("AndroidLauncher", "start: onSignInSucceeded()");
}
@Override
public void onSignInFailed() {
Gdx.app.log("AndroidLauncher", "start: onSignInFailed()");
}
};
_gameHelper.setup(gameHelperListener);
// main code
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
initialize(new FFeather(this), config);
}
@Override
public void signIn() {
Gdx.app.log("AndroidLauncher", "start: signIn()");
}
....
接口IGoogleServices
,我认为错误与之相关
public interface IGoogleServices {
public void signIn();
public void signOut();
public void rateGame();
public void submitScore(long score);
public void showScores();
public boolean isSignedIn();
}
异常消息应该包含更多的回溯(在logcat的最后一行之后)。你能包括那些细节吗?我怀疑
Gdx.app
尚未完全初始化,但了解更多关于它进入“登录”步骤的程度会有所帮助。异常消息应该包括更多的回溯(在logcat的最后一行之后)。你能包括那些细节吗?我怀疑Gdx.app
尚未完全初始化,但了解更多关于它进入“登录”步骤的程度会有所帮助。异常消息应该包括更多的回溯(在logcat的最后一行之后)。你能包括那些细节吗?我怀疑,Gdx.app
尚未完全初始化,但了解更多关于它进入“登录”步骤的信息会有所帮助。