com.unity3d.player.UnityPlayerNativeActivity activity is missing from your android manifest

com.unity3d.player.UnityPlayerNativeActivity activity is missing from your android manifest. AddEnergy “” to your activity tag so that Chartboost can forward touch events to the advertisements.
UnityEngine.Debug:LogError(Object)
ChartboostSDK.CBManifest:CheckAndFixManifest() (at Assets/Chartboost/Editor/CBManifestEditor.cs:65)
ChartboostSDK.CBManifest:GenerateManifest() (at Assets/Chartboost/Editor/CBManifestEditor.cs:30)
ChartboostSDK.ChartboostPostProcess:PostProcessBuild_Android(String) (at Assets/Chartboost/Editor/CBPostProcess.cs:51)
ChartboostSDK.ChartboostPostProcess:OnPostProcessBuild(BuildTarget, String) (at Assets/Chartboost/Editor/CBPostProcess.cs:36)
UnityEditor.HostView:OnGUI()

I get the above error when I build for android.
I go to Assets->Plugins->Android->AndroidManifest and there it is the manifest itself:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="3" android:versionName="1.0" package="com.Toughwin.MemoryRun" android:installLocation="preferExternal">
  <uses-permission android:name="com.android.vending.BILLING" />
  <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
  <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:hardwareAccelerated="true" android:theme="@android:style/Theme.NoTitleBar" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner" android:name="com.soomla.SoomlaApp">
    <activity android:label="@string/app_name" android:name="com.unity3d.player.UnityPlayerManagerNativeActivity" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
      <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>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    </activity>
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    <!-- Google Mobile Ads Activity -->
    <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:name="com.google.android.gms.ads.AdActivity" />
    <activity android:name="com.soomla.store.billing.google.GooglePlayIabService$IabActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <meta-data android:name="billing.service" android:value="google.GooglePlayIabService" />
  </application>
  <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="21" />
  <!-- Google Mobile Ads Permissions -->
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-feature android:glEsVersion="0x00020000" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>

You can clearly see that the activity is in the android manifest.

What is the problem? Am I looking at the wrong manifest or what?

It’s a bug in Chartboosts CBManifest.cs script, for some reason it is using FindElementWithAndroidName to find the element in the manifest but it always fails. It’s just a check so comment it out:-

Open CBManifest.cs.
Comment out lines 62 to 67 that start:

  • XmlElement unityActivityElement = FindElementWithAndroidName(“activity”, “name”, ns, unityNativeActivityName, dict);

And then 82 to 97 that start with:

  • XmlElement forwardNativeEventsToDalvikElement = FindElementWithAndroidName(“meta-data”, “name”, ns, “unityplayer.ForwardNativeEventsToDalvik”, unityActivityElement);