지금 Google Play Game Service 를 적용해보려고 테스트 중인데 초기화 부분에서 막혀서 질문 올려봅니다.
https://developers.google.com/games/services/android/init
위 링크를 따라 초기화 예제를 만들고 있는데 BaseGameActivity를 상속하기만 하면 실행이 전혀 되지 않습니다.
java.lang.IllegalStateException에러가 뜨고 (맨 아래쪽에 에러 복사해뒀습니다 ㅠㅠ)
메인 액티비티 실행조차 되고 있지 않습니다.
저 예제 따라 그대로 진행해고 있는데 왜 이런지 모르겠네요 ..;;
혹시 적용해보신분들 도움좀 받았으면 좋겠습니다 ㅠ
package com.sizzling.unitygpgsplugin;
import com.google.example.games.basegameutils.BaseGameActivity;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
public class MainActivity extends BaseGameActivity implements View.OnClickListener
{
Button btnLogin;
ImageView profilePic;
TextView profileName;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnLogin = (Button)findViewById(R.id.btn_login);
profilePic = (ImageView)findViewById(R.id.img_userprofile);
profileName = (TextView)findViewById(R.id.txt_user_name);
btnLogin.setOnClickListener(this);
}
@Override
public void onSignInFailed() {
profileName.setText("LOGIN FAILED");
}
@Override
public void onSignInSucceeded() {
profileName.setText("LOGIN SUCCESS");
}
@Override
public void onClick(View v) {
switch(v.getId())
{
case R.id.btn_login:
beginUserInitiatedSignIn();
break;
}
}
}
09-15 11:16:54.790: I/dalvikvm(3006): Could not find method android.view.View.getDisplay, referenced from method com.google.android.gms.internal.bv$b.b
09-15 11:16:54.790: W/dalvikvm(3006): VFY: unable to resolve virtual method 3183: Landroid/view/View;.getDisplay ()Landroid/view/Display;
09-15 11:16:54.790: D/dalvikvm(3006): VFY: replacing opcode 0x6e at 0x0009
09-15 11:16:54.870: W/PopupManager(3006): 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 the API. Use setViewForPopups() to set your content view.
~
09-15 11:16:55.085: W/dalvikvm(3006): threadid=1: thread exiting with uncaught exception (group=0x418412a0)
09-15 11:16:55.095: E/AndroidRuntime(3006): FATAL EXCEPTION: main
09-15 11:16:55.095: E/AndroidRuntime(3006): java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
09-15 11:16:55.095: E/AndroidRuntime(3006): at com.google.android.gms.internal.u$f.a(Unknown Source)
09-15 11:16:55.095: E/AndroidRuntime(3006): at com.google.android.gms.internal.u$f.a(Unknown Source)
09-15 11:16:55.095: E/AndroidRuntime(3006): at com.google.android.gms.internal.u$b.A(Unknown Source)
09-15 11:16:55.095: E/AndroidRuntime(3006): at com.google.android.gms.internal.u$a.handleMessage(Unknown Source)
09-15 11:16:55.095: E/AndroidRuntime(3006): at android.os.Handler.dispatchMessage(Handler.java:99)
09-15 11:16:55.095: E/AndroidRuntime(3006): at android.os.Looper.loop(Looper.java:137)
09-15 11:16:55.095: E/AndroidRuntime(3006): at android.app.ActivityThread.main(ActivityThread.java:4946)
09-15 11:16:55.095: E/AndroidRuntime(3006): at java.lang.reflect.Method.invokeNative(Native Method)
09-15 11:16:55.095: E/AndroidRuntime(3006): at java.lang.reflect.Method.invoke(Method.java:511)
09-15 11:16:55.095: E/AndroidRuntime(3006): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1036)
09-15 11:16:55.095: E/AndroidRuntime(3006): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:803)
09-15 11:16:55.095: E/AndroidRuntime(3006): at dalvik.system.NativeStart.main(Native Method)
09-15 11:21:55.250: I/Process(3006): Sending signal. PID: 3006 SIG: 9