Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

"You uploaded an Android App Bundle that has an activity without android:exported set"

Discussion in 'Android' started by CapruxSolder11, Jan 26, 2022.

  1. CapruxSolder11

    CapruxSolder11

    Joined:
    Jan 15, 2017
    Posts:
    4
    I require some assistance with publishing to Google Play. My game was having issues being run on Android 12 and above, so I adjusted the manifest accordingly and tried to publish it. Alas, I keep getting two errors: It says that I don't have android:exported property set for my activities and services, but I slapped the property on all the activities properly. Here is the Manifest:
    Code (xml):
    1.  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    2.     package="com.XiaoKhanGames.GuttingGoblins"
    3.     android:versionCode="42"
    4.     android:versionName="1.4" >
    5.  
    6.  
    7.  
    8.    <application>
    9.  
    10.     <!-- The space in these forces it to be interpreted as a string vs. int -->
    11.     <meta-data android:name="com.google.android.gms.games.APP_ID"
    12.         android:value="\u0031011141426263"
    13.                android:exported="true"/>
    14.  
    15.     <!--meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" /-->
    16.  
    17.     <!-- Keep track of which plugin is being used -->
    18.     <meta-data android:name="com.google.android.gms.games.unityVersion"
    19.         android:value="\u0030.10.14"
    20.                android:exported ="false"/>
    21.  
    22.  
    23.  
    24.  
    25.  
    26.     <activity android:name="com.XiaoKhanGames.GuttingGoblins.UnityPlayerActivity"
    27.               android:exported="false" />
    28.  
    29.     <activity android:name="com.unity3d.player.UnityPlayerActivity"
    30.               android:exported="false"
    31.              android:theme="@style/UnityThemeSelector"/>
    32.            
    33.  
    34.     <action android:name="android.intent.action.MAIN"
    35.               android:exported="false"/>
    36.  
    37.     <activity android:name="android.intent.category.LAUNCHER"
    38.               android:exported ="true"/>
    39.  
    40.     <meta-data android:name="unityplayer.UnityActivity" android:value="true"
    41.                android:exported="true"/>

    Any and all help is appreciated. Thank you!
     
  2. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    Share the final merged manifest to have a look. You can get it by following this post.
     
  3. CapruxSolder11

    CapruxSolder11

    Joined:
    Jan 15, 2017
    Posts:
    4
    Code (JavaScript):
    1. <?xml version="1.0" encoding="utf-8"?>
    2.  
    3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    4.     package="com.XiaoKhanGames.GuttingGoblins"
    5.     android:versionCode="50"
    6.     android:versionName="1.4" >
    7.  
    8.  
    9.  
    10.   <application>
    11.  
    12.     <!-- The space in these forces it to be interpreted as a string vs. int -->
    13.     <meta-data android:name="com.google.android.gms.games.APP_ID"
    14.         android:value="\u0031011141426263"
    15.         android:exported="true"/>
    16.            
    17.  
    18.     <!--meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" /-->
    19.  
    20.     <!-- Keep track of which plugin is being used -->
    21.     <meta-data android:name="com.google.android.gms.games.unityVersion"
    22.         android:value="\u0030.10.14"
    23.     android:exported="false"/>
    24.  
    25.     <activity android:name="com.XiaoKhanGames.GuttingGoblins.UnityPlayerActivity"
    26.               android:exported="false" />
    27.  
    28.     <activity android:name="com.unity3d.player.UnityPlayerActivity"
    29.              android:theme="@style/UnityThemeSelector"
    30.               android:exported="false"/>
    31.  
    32.     <action android:name="android.intent.action.MAIN"
    33.               android:exported="true"/>
    34.  
    35.     <activity android:name="android.intent.category.LAUNCHER"
    36.               android:exported ="true"/>
    37.  
    38.     <meta-data android:name="unityplayer.UnityActivity" android:value="true"
    39.                android:exported="false"/>
    40.  
    41.     <uses-sdk
    42.         android:minSdkVersion="21"
    43.         android:targetSdkVersion="32" />
    44.  
    45.     <supports-screens
    46.         android:anyDensity="true"
    47.         android:largeScreens="true"
    48.         android:normalScreens="true"
    49.         android:smallScreens="true"
    50.         android:xlargeScreens="true" />
    51.  
    52.     <uses-feature android:glEsVersion="0x00020000" />
    53.  
    54.     <uses-permission android:name="android.permission.INTERNET" />
    55.     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    56.  
    57.     <uses-feature
    58.         android:name="android.hardware.sensor.accelerometer"
    59.         android:required="false" />
    60.     <uses-feature
    61.         android:name="android.hardware.touchscreen"
    62.         android:required="false" />
    63.     <uses-feature
    64.         android:name="android.hardware.touchscreen.multitouch"
    65.         android:required="false" />
    66.     <uses-feature
    67.         android:name="android.hardware.touchscreen.multitouch.distinct"
    68.         android:required="false" />
    69.     <!-- Permission will be merged into the manifest of the hosting app. -->
    70.     <!-- Is required to launch foreground extraction service for targetSdkVersion 28+. -->
    71.     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    72.  
    73.     <application
    74.         android:icon="@mipmap/app_icon"
    75.         android:label="@string/app_name"
    76.         android:theme="@style/UnityThemeSelector" >
    77.       <activity
    78.           android:name="com.unity3d.player.UnityPlayerActivity"
    79.           android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
    80.           android:hardwareAccelerated="false"
    81.           android:label="@string/app_name"
    82.           android:launchMode="singleTask"
    83.           android:screenOrientation="sensorLandscape"
    84.           android:exported="false">
    85.         <intent-filter>
    86.           <action android:name="android.intent.action.MAIN"
    87.                   android:exported="true"/>
    88.  
    89.           <category android:name="android.intent.category.LAUNCHER"
    90.                     android:exported="true"/>
    91.         </intent-filter>
    92.  
    93.         <meta-data
    94.             android:name="unityplayer.UnityActivity"
    95.             android:value="true" />
    96.       </activity>
    97.  
    98.       <meta-data
    99.           android:name="unity.build-id"
    100.           android:value="c0771b36-620f-4420-a9d8-0a632fcfa5e0" />
    101.       <meta-data
    102.           android:name="unity.splash-mode"
    103.           android:value="0" />
    104.       <meta-data
    105.           android:name="unity.splash-enable"
    106.           android:value="True" />
    107.       <!-- The activities will be merged into the manifest of the hosting app. -->
    108.       <activity
    109.           android:name="com.google.android.play.core.missingsplits.PlayCoreMissingSplitsActivity"
    110.           android:enabled="false"
    111.           android:exported="false"
    112.           android:launchMode="singleInstance"
    113.           android:process=":playcore_missing_splits_activity"
    114.           android:stateNotNeeded="true" />
    115.       <activity
    116.           android:name="com.google.android.play.core.common.PlayCoreDialogWrapperActivity"
    117.           android:exported="false"
    118.           android:stateNotNeeded="true"
    119.           android:theme="@style/Theme.PlayCore.Transparent" />
    120.       <!-- The services will be merged into the manifest of the hosting app. -->
    121.       <service
    122.           android:name="com.google.android.play.core.assetpacks.AssetPackExtractionService"
    123.           android:enabled="false"
    124.           android:exported="true" >
    125.         <meta-data
    126.             android:name="com.google.android.play.core.assetpacks.versionCode"
    127.             android:value="11002" />
    128.       </service>
    129.       <service
    130.           android:name="com.google.android.play.core.assetpacks.ExtractionForegroundService"
    131.           android:enabled="false"
    132.           android:exported="false" />
    133.     </application>
    134.  
    135.   </application>
    136. </manifest>

    I merged the manifests and this is the grand manifest. The one you pointed me to no longer exists after it deleted itself
     
  4. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    Sorry!
    I don't see anything wrong with the shared manifest. I only have an option to check the apk (empty apk is fine) to see more details.
     
  5. CapruxSolder11

    CapruxSolder11

    Joined:
    Jan 15, 2017
    Posts:
    4
    Figured it out. Deleted all the manifests in the assets and copied the manifest template from the androidPlayer to the project, then added my tweaks. Worked like a beaut. Thanks man!!!
     
    Voxel-Busters likes this.