그 자체로 잘 작동하는 타사 게임 응용 프로그램이 있습니다.게임이 다른 활동에서 실행되지 않습니다.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" android:theme="@android:style/Theme.NoTitleBar" package="com.thirdpartycompany.appname">
......
<application android:debuggable="false" android:icon="@drawable/app_icon" android:label="@string/app_name">
<activity android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:label="@string/app_name" android:launchMode="singleTask" android:name="com.abc.ThirdPartyActivity" android:screenOrientation="fullSensor">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
</intent-filter>
......
</activity>
......
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 1095208937458"/>
<meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="\ 1095208937458"/>
......
</application>
......
</manifest>
그때 다른 활동 MyActivity를 추가하고 다음 코드를 추가 : 여기
Intent intent = new Intent();
intent.setClassName("com.thirdpartycompany.appname", "com.abc.ThirdPartyActivity");
startActivityForResult(intent, 7774);
을 새로운 AndroidManifest.xml에있다 :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" android:theme="@android:style/Theme.NoTitleBar" package="com.thirdpartycompany.appname">
<application android:debuggable="false" android:icon="@drawable/app_icon" android:label="@string/app_name">
<activity android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:label="@string/app_name" android:name="com.abc.ThirdPartyActivity" android:screenOrientation="fullSensor">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.mycompany.MyActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 1095208937458" />
<meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="\ 1095208937458" />
</application>
</manifest>
여기에 원래의 AndroidManifest.xml입니다 새 응용 프로그램을 시작하면 다음 예외가 발생합니다.
FATAL EXCEPTION [main]
Unity version : 4.5.5f1
Device model : intel I861B3L2CA51
Device fingerprint: intel/inet_alc5651_64/inet_alc5651:5.1.1/LMY47V/inet-soft0204291144:userdebug/release-keys
- [FATAL EXCEPTION [main]
Unity version : 4.5.5f1
Device model : intel I861B3L2CA51
Device fingerprint: intel/inet_alc5651_64/inet_alc5651:5.1.1/LMY47V/inet-soft0204291144:userdebug/release-keys
] : java.lang.Error: FATAL EXCEPTION [main]
Unity version : 4.5.5f1
Device model : intel I861B3L2CA51
Device fingerprint: intel/inet_alc5651_64/inet_alc5651:5.1.1/LMY47V/inet-soft0204291144:userdebug/release-keys
Caused by: java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
at com.google.android.gms.internal.hb$h.b(Unknown Source)
at com.google.android.gms.internal.hb$h.d(Unknown Source)
at com.google.android.gms.internal.hb$b.fv(Unknown Source)
at com.google.android.gms.internal.hb$a.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Google에서 검색하여 Initializing Games Client in Android 및 I can't initialize Google Play game service을 찾았습니다. 제안 된 해결책은 AndroidManifest.xml에
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="@string/app_id" />
을 추가하는 것입니다. AndroidManifest.xml에는 이미이 두 줄이 있지만 동일한 예외가 있습니다. 아무도 여기서 무슨 일이 일어 났는지 알아? 감사!
매니페스트에 "com.mycompany.MyActivity"를 추가했습니다. "com.thirdpartycompany.MyActivity"가 아니어야합니까? 패키지 이름이 맞습니까? – W0rmH0le
"com.mycompany.MyActivity", "com.abc.ThirdPartyActivity"및 "com.thirdpartycompany.appname"이 좋습니다. 이 문제는 Google Play 게임 서비스와 관련이있을 수 있지만 원래 애플리케이션이 정상적으로 작동합니다. – user3869992