Using two Unity Android Plugins that want to be the main activity?

I’m using two native Android plugins the INABS (In App Billing Service) and BFS Google Play Game Services plugin. I can make each one work individually. But I can’t make both run at the same time. As far as I can tell it is due to the fact that both plugins want to be launched as main activities in the manifest like so.

	</activity>
		<activity android:name="com.bfsgooglegames.GoogleGamesUnityPlayerProxyActivity"
                  android:launchMode="singleTask"
                  android:label="@string/app_name"
                  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    	<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>
    </activity>

	<activity android:name="com.itoysoft.android.activity.AndroidIAPActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">  
		<intent-filter>
    		<action android:name="android.intent.action.MAIN" />
    		<category android:name="android.intent.category.LAUNCHER" />
  		</intent-filter>
	</activity>

In that order BFS works when INABS fails and the reverse applies if the order is changed.

Removing the Main action and Launcher category from one or the other appears to have the same effect.

This seems to indicate that it is possible to manually start a Unity Android plugin using JNI but the sample appears a bit unclear and confusing.

Is there any way of having both of these plugins working?

I did not fully understand the part in your question where you mention "In that order BFS works… "

In any case - there can be only 1 main activity to your Unity game: either the one that comes out of the box, or a custom one that you provide.

I am not familiar with the plugins you describe, but i suppose they provide their own activity to perform certain initialization upon the app’s startup (are they displaying anything when the game starts?)

You should check with the plugins’ developers to see if it is mandatory for each one to be the main activity, and if not, perhaps they provide some other initialization API so you can manually initialize the plugin instead of it running in its own custom defined activity.