I have a third party game application which works fine by itself. Here is the original AndroidManifest.xml:
<?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>
I then added another activity MyActivity and added the following code:
Intent intent = new Intent();
intent.setClassName("com.thirdpartycompany.appname", "com.abc.ThirdPartyActivity");
startActivityForResult(intent, 7774);
Here is the new 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>
When I launch the new application, I got the following exception:
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)
I searched on google and found Initializing Games Client in Android and I can't initialize Google Play game service. The suggested solution is to add
<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" />
to AndroidManifest.xml. I already have those two lines in my AndroidManifest.xml but still got the same exception. Does anyone know what has happened here? Thanks!