问题
I'm having a problem working with this two plugins together: on the AndroidManifest.xml both of them need to be "android.intent.category.LAUNCHER"
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:debuggable="false">
<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerNativeActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientat ion|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<action android:name="android.intent.action.MAIN" />
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<activity android:name="com.unity3d.player.VideoPlayer" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.facebook.LoginActivity" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation">
</activity>
<activity android:name="com.facebook.unity.FBUnityPlayerActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 273811112771671" />
</application>
Is there any solution available for this trouble? I think it's very common.
回答1:
We have a Beta version of v5.0.2 of the SDK to try to address this issue: https://developers.facebook.com/docs/unity/downloads/
Basically we deprecated requiring FBUnityPlayerActivity
to be the main activity. This should allow you to use whatever main activity you like.
It's still in beta as we're working out the kinks. If you still have the old version of the Facebook SDK on your project, after importing this go to "Facebook->Edit Settings" then inside the "Android Build Settings" tab, click "Regenerate Android Manifest". That should modify it with the new facebook activities. You should then be free to modify your AndroidManifest.xml to make Vuforia your main activity.
来源:https://stackoverflow.com/questions/20928723/how-to-work-with-facebook-sdk-for-unity-and-vuforia-for-android