Search Unity

Game Doesn't Install on Android 12 from Playstore

Discussion in 'Android' started by instruct9r, Jan 8, 2022.

  1. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    hi sir hope you are doing well and good i need little help i have message you in inbox but i think my game have some thing accessing or some activities to be define in manifest but i cant find which one i have add the script your guided have make apk but can't be sent here as its little large for this to be post as file kindly check inbox and give me little guidance
     
  2. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    Upload it somewhere(WeTranfer) and pass me the link to download. Surprisingly, It's not allowing me to send a message to your conversation.
     
  3. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    okay sir thanks a lot i am uploading to google drive and sendyou link here
     
  4. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
  5. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.unity.ads" android:versionName="1.0" android:versionCode="1">
    <application>
    <uses-library android:required="false" android:name="org.apache.http.legacy" />
    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713" />
    </application>
    </manifest>

    this is manifest
     
  6. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    sir my apk google drive link not approve by moderator here so i send it in your inbox let me know if there in any issue kindly check inbox
     
  7. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    DID YOU RECIVE MY APK SIR DO YOU WORKING ON?
     
  8. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    I checked it and didn't find any wrong with the manifest.
    Try installing on android 12 device and pass me the complete log (adb install apkname.apk)
     
    rizwankhan123 likes this.
  9. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    thanks for your time sir , i am going to install on android 12 , and kindly let me know how will i get complete log and what is( adb install apkname.apk )mean
     
  10. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    you can try installing from the terminal with the below command
    Code (CSharp):
    1. adb install -r YOU_APK_PATH
    Once you try to install, if it fails installing, it will throw an error which you need to pass it here. If it installs successfully, it means you don't have issue related to manifest export flag. Then you need capture the log from logcat tool either from Unity or Android studio. I suggest you to check the docs regarding capturing logcat here.
     
    rizwankhan123 likes this.
  11. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    okay i going to follow the process and will let you know the result
     
  12. ahmedandre

    ahmedandre

    Joined:
    Jul 26, 2014
    Posts:
    20
    Last edited: Jun 8, 2022
  13. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    Code (CSharp):
    1.         <activity android:theme="@style/VrActivityTheme" android:name="com.unity.purchasing.googleplay.VRPurchaseActivity" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" android:enableVrMode="com.google.vr.vrcore/com.google.vr.vrcore.common.VrCoreListenerService">
    2.             <intent-filter>
    3.                 <action android:name="com.google.vr.vrcore.ACTION_NONE"/>
    4.                 <category android:name="com.google.intent.category.DAYDREAM"/>
    5.             </intent-filter>
    6.         </activity>
    Seems like your vr package has the issue. If its from unity, make sure you use the latest version which supports android 12. The script shared only patches the main activity of unity's but not all.
     
  14. ahmedandre

    ahmedandre

    Joined:
    Jul 26, 2014
    Posts:
    20
    Thanks for your quick reply. I removed the VR Package and it's still the vr activity not with android export = true.
    Is it related to Unity Purchasing ? if it is, upgrading to latest unity is a great problem for me...
    Do you have a solution how to edit the manfiset of Unity Purchasing / VR package ?
     
  15. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    Looks like its from unity iap. Check if they have updates.
     
  16. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    I UDATED MY GAME TO UNITY 2019 AND THEN ITS DONE I DONT KNOW WHAT WILL BE HAPPLEN WHEN WE HAVE GAMES IN 2017 AND 2018 AND NOT UPDATABLE TO 2019 I DONT KNOW THE ROOT CAUS BUT I EXPECT THE EXPERT CAN FIND SOME SOULUTION
     
  17. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    The editor script posted in this thread didn't work for me (Unity 2018.4.36). Using custom Android Manifest did work. I copied it from "C:\Program Files\Unity2018\Editor\Data\PlaybackEngines\AndroidPlayer\Apk" into "Assets\Plugins\Android" and then added android:exported="true" attribute before closing ">" into <activity>. After that Google Play allowed to upload my apk without a warning.
     
  18. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13


    <?xml version="1.0" encoding="utf-8"?>
    <manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.unity3d.player"
    xmlns:tools="http://schemas.android.com/tools"
    android:installLocation="preferExternal">
    <supports-screens
    android:smallScreens="true"
    android:normalScreens="true"
    android:largeScreens="true"
    android:xlargeScreens="true"
    android:anyDensity="true"/>

    <application
    android:theme="@StyLe/UnityThemeSelector"
    android:icon="@drawable/app_icon"
    android:label="@String/app_name">
    <activity android:name="com.unity3d.player.UnityPlayerActivity"
    android:label="@String/app_name">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    </application>
    </manifest>


    which line shoud i do and where kindly guide
     
  19. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    This line:
    Code (CSharp):
    1. <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@String/app_name">
    Should be changed into:
    Code (CSharp):
    1. <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@String/app_name" android:exported="true">
     
    Voxel-Busters likes this.
  20. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    okay and thank you soo much the big clue and path for me is i find that unity have its own manifest from your post and i think its a very big clue for me realy great learning thanks again
     
  21. rizwankhan123

    rizwankhan123

    Joined:
    Apr 7, 2018
    Posts:
    13
    i neeed guidence in one thing i want to use admob ads in unity i tryied many version googleads pkg admob pakage it dont show ads as as will crash in mobile i tried empthy project so kindly recomnt me a pakage that work in unity 2017 and 18 also or shara any helpful vidoe i will follow
     
  22. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    I never used ads, so I'm not the one who can help you with that. Besides, it's better to create a different thread for a different problem.
     
  23. kingzustin

    kingzustin

    Joined:
    Jan 16, 2018
    Posts:
    8
    This worked for me too! Thanks!!
    (Unity 2020.3.36, latest Google Play, Admob, and Firebase SDKs, API level 33)
     
    Voxel-Busters likes this.
  24. ForsakenOne17

    ForsakenOne17

    Joined:
    Jul 29, 2021
    Posts:
    3

    Hello.
    I tried your method and it did not work for me, maybe I'm doing something wrong.
    I have plugin installed
    Cross Platform Native Plugins : Essential Kit (Mobile - iOS & Android) and
    firebase, onesignal
    Unity version 2021.3.6f1

    Asset/Plugins/Android/com.voxelbusters.essentialkit.androidlib found the AndroidManifest minifest there is a line android:exported="false" and if you change it to true after the build, its value becomes false

    link to my apk file
    https://drive.google.com/file/d/1ZBrJE3KDNtFB4FL7Ouh_pASbxq22ME_v/view?usp=sharing
     

    Attached Files:

  25. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    Any reason why you want to change the flag to true? We handle generating the manifest file dynamically and you need to change from code.

    If you can share the exact issue you are facing so that we can help you out quickly.

    Cheers,
    VB Team
     
  26. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    Thanks for sharing the apk. I see the problem is with OneSignal. So would request you to check if there are any updates from them.

    Code (CSharp):
    1.         <receiver android:name="com.onesignal.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
    2.             <intent-filter>
    3.                 <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
    4.                 <category android:name="com.folokto.nitropongsportbet"/>
    5.             </intent-filter>
    6.         </receiver>
    The above section missing android:exported flag.
     
  27. ForsakenOne17

    ForsakenOne17

    Joined:
    Jul 29, 2021
    Posts:
    3
    OneSignal had an update, will you have the opportunity to check if this error is still there or tell me how to check it yourself if it's not difficult for you?

    https://drive.google.com/file/d/1HAtEATfGwxewzYfSo3Smbdi6wgBhgelm/view?usp=sharing
     
  28. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    Yes!
    The issue still exists.
    It should be

    Code (CSharp):
    1. <receiver android:name="com.onesignal.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" android:exported="false or true">
    2.             <intent-filter>
    3.                 <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
    4.                 <category android:name="com.folokto.nitropongsportbet"/>
    5.             </intent-filter>
    6.         </receiver>
    Instead of

    Code (CSharp):
    1. <receiver android:name="com.onesignal.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
    2.             <intent-filter>
    3.                 <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
    4.                 <category android:name="com.folokto.nitropongsportbet"/>
    5.             </intent-filter>
    6.         </receiver>
     
  29. ForsakenOne17

    ForsakenOne17

    Joined:
    Jul 29, 2021
    Posts:
    3

    Thanks, my mistake was not noticed in the past answer, put the android:exported flag. Already tried to download aab and Google accepted it, thank you very much!)))
     
    Voxel-Busters likes this.
  30. Achir

    Achir

    Joined:
    Mar 22, 2020
    Posts:
    1
    Where is i add this code?
     
  31. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    I would first suggest to update the unity notification package as they might have fixed it by now as the issue started sometime back.

    If you don't find an update, you may need to create a custom AndroidManifest file under Assets/Plugins/Android folder (you can create with just a checkmark via player settings -> Publishing settings) and add the above lines.

    Let me know how it goes!
     
  32. andrew_pearce_

    andrew_pearce_

    Joined:
    Nov 5, 2018
    Posts:
    169
    Thanks @Voxel-Busters, you were right regarding AndroidNotifications plugin. We cannot update it because we need Android 4.4 support. So we simplified your solution and added adndroid:exorted="true" to both launcher activity as well as notification receiver:

    Code (CSharp):
    1. using System.IO;
    2. using System.Xml;
    3. using System.Text;
    4. using UnityEditor.Android;
    5.  
    6. #if UNITY_EDITOR && UNITY_ANDROID
    7. public class AndroidPostBuildProcessor : IPostGenerateGradleAndroidProject {
    8.  
    9.   public void OnPostGenerateGradleAndroidProject(string basePath) {
    10.     AndroidManifest androidManifest = new AndroidManifest(basePath);
    11.  
    12.     // For API 31+ support (Need explicit exported flag for entries having intent-filter tags)
    13.     androidManifest.SetStartingActivityAttribute("exported", "true");
    14.     androidManifest.SetAndroidNotificationsAttribute("exported", "true");
    15.  
    16.     androidManifest.Save();
    17.   }
    18.  
    19.   public int callbackOrder { get { return 1; } }
    20.  
    21.   internal class AndroidManifest : XmlDocument {
    22.     private const string AndroidXmlNamespace = "http://schemas.android.com/apk/res/android";
    23.  
    24.     private XmlNamespaceManager nsMgr;
    25.     private string filePath;
    26.  
    27.     public AndroidManifest(string basePath) {
    28.       filePath = Path.Combine(basePath, "src", "main", "AndroidManifest.xml");
    29.       using (var reader = new XmlTextReader(filePath)) {
    30.         reader.Read();
    31.         Load(reader);
    32.       }
    33.       nsMgr = new XmlNamespaceManager(this.NameTable);
    34.       nsMgr.AddNamespace("android", AndroidManifest.AndroidXmlNamespace);
    35.     }
    36.  
    37.     public void Save() {
    38.       using (var writer = new XmlTextWriter(filePath, new UTF8Encoding(false))) {
    39.         writer.Formatting = Formatting.Indented;
    40.         Save(writer);
    41.       }
    42.     }
    43.  
    44.     private XmlAttribute CreateAndroidAttribute(string key, string value) {
    45.       XmlAttribute attr = CreateAttribute("android", key, AndroidManifest.AndroidXmlNamespace);
    46.       attr.Value = value;
    47.       return attr;
    48.     }
    49.  
    50.     internal void SetStartingActivityAttribute(string key, string value) {
    51.       XmlNode node = SelectSingleNode("/manifest/application/activity[@android:name='com.unity3d.player.UnityPlayerActivity']", nsMgr);
    52.       if (node != null) {
    53.         XmlAttributeCollection attributes = node.Attributes;
    54.         attributes.Append(CreateAndroidAttribute(key, value));
    55.       }
    56.     }
    57.  
    58.     internal void SetAndroidNotificationsAttribute(string key, string value) {
    59.       XmlNode node = SelectSingleNode("/manifest/application/receiver[@android:name='com.unity.androidnotifications.UnityNotificationRestartOnBootReceiver']", nsMgr);
    60.       if (node != null) {
    61.         XmlAttributeCollection attributes = node.Attributes;
    62.         attributes.Append(CreateAndroidAttribute(key, value));
    63.       }
    64.     }
    65.   }
    66. }
    67. #endif
    p.s. It can also be further modified to add other plugins. Simply create a new method and use similar XML node search as Voxel-Busters did in his initial script.
     
    Last edited: Oct 29, 2022
    Voxel-Busters likes this.
  33. Jon_Wick

    Jon_Wick

    Joined:
    Jul 12, 2017
    Posts:
    9

    Hi,
    Could you please advice what can be the issue with my game's manifest file?
    I'm using Unity 2021.3.12f1 and android:exported="true" is added, but still Google Play Console throws error when loading .aab

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools">
    <application android:extractNativeLibs="true">
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@StyLe/UnityThemeSelector" android:screenOrientation="portrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:resizeableActivity="false" android:hardwareAccelerated="false" android:exported="true">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    <meta-data android:name="unity.splash-mode" android:value="0" />
    <meta-data android:name="unity.splash-enable" android:value="True" />
    <meta-data android:name="unity.launch-fullscreen" android:value="True" />
    <meta-data android:name="unity.allow-resizable-window" android:value="False" />
    </application>
    <uses-feature android:glEsVersion="0x00020000" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <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>
     
  34. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    Share complete merged manifest file or an empty apk to look into.
     
  35. Jon_Wick

    Jon_Wick

    Joined:
    Jul 12, 2017
    Posts:
    9
    Hi, sorry for delayed response. It seems I fixed the initial issue with the manifest - it was caused by obsolete asset that modified the manifest file.
    But still can't pass Google Play validation when uploading .aab build. The error is the following:
    Your APK cannot be analyzed using aapt. Error output:
    Failed to run aapt dump badging:
    AndroidManifest.xml:208: error: ERROR getting 'android:value' or 'android:resource' attribute for meta-data: error print resolved resource attribute

    Here is full manifest file
    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest
    3.     xmlns:android="http://schemas.android.com/apk/res/android"
    4.     android:versionCode="31"
    5.     android:versionName="1.03"
    6.     android:installLocation="0"
    7.     android:compileSdkVersion="31"
    8.     android:compileSdkVersionCodename="12"
    9.     package="com.my.game"
    10.     platformBuildVersionCode="31"
    11.     platformBuildVersionName="12">
    12.  
    13.     <uses-sdk
    14.         android:minSdkVersion="26"
    15.         android:targetSdkVersion="31" />
    16.  
    17.     <supports-screens
    18.         android:anyDensity="true"
    19.         android:smallScreens="true"
    20.         android:normalScreens="true"
    21.         android:largeScreens="true"
    22.         android:xlargeScreens="true" />
    23.  
    24.     <uses-feature
    25.         android:glEsVersion="0x20000" />
    26.  
    27.     <uses-permission
    28.         android:name="android.permission.INTERNET" />
    29.  
    30.     <uses-permission
    31.         android:name="android.permission.ACCESS_NETWORK_STATE" />
    32.  
    33.     <uses-feature
    34.         android:name="android.hardware.touchscreen"
    35.         android:required="false" />
    36.  
    37.     <uses-feature
    38.         android:name="android.hardware.touchscreen.multitouch"
    39.         android:required="false" />
    40.  
    41.     <uses-feature
    42.         android:name="android.hardware.touchscreen.multitouch.distinct"
    43.         android:required="false" />
    44.  
    45.     <uses-permission
    46.         android:name="com.google.android.gms.permission.AD_ID" />
    47.  
    48.     <uses-permission
    49.         android:name="com.android.vending.BILLING" />
    50.  
    51.     <queries>
    52.  
    53.         <intent>
    54.  
    55.             <action
    56.                 android:name="com.google.android.gms.games.VIEW_LEADERBOARDS" />
    57.         </intent>
    58.  
    59.         <intent>
    60.  
    61.             <action
    62.                 android:name="com.google.android.gms.games.VIEW_ACHIEVEMENTS" />
    63.         </intent>
    64.     </queries>
    65.  
    66.     <uses-permission
    67.         android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    68.  
    69.     <uses-permission
    70.         android:name="android.permission.VIBRATE" />
    71.  
    72.     <application
    73.         android:label="@ref/0x7f0b0027"
    74.         android:icon="@ref/0x7f0a0000"
    75.         android:extractNativeLibs="true"
    76.         android:appComponentFactory="androidx.core.app.CoreComponentFactory">
    77.  
    78.         <activity
    79.             android:theme="@ref/0x7f0c0009"
    80.             android:name="com.unity3d.player.UnityPlayerActivity"
    81.             android:exported="true"
    82.             android:launchMode="2"
    83.             android:screenOrientation="1"
    84.             android:configChanges="0x40003fff"
    85.             android:hardwareAccelerated="false"
    86.             android:resizeableActivity="false">
    87.  
    88.             <intent-filter>
    89.  
    90.                 <action
    91.                     android:name="android.intent.action.MAIN" />
    92.  
    93.                 <category
    94.                     android:name="android.intent.category.LAUNCHER" />
    95.             </intent-filter>
    96.  
    97.             <meta-data
    98.                 android:name="unityplayer.UnityActivity"
    99.                 android:value="true" />
    100.         </activity>
    101.  
    102.         <meta-data
    103.             android:name="unity.splash-mode"
    104.             android:value="0" />
    105.  
    106.         <meta-data
    107.             android:name="unity.splash-enable"
    108.             android:value="true" />
    109.  
    110.         <meta-data
    111.             android:name="unity.launch-fullscreen"
    112.             android:value="true" />
    113.  
    114.         <meta-data
    115.             android:name="unity.allow-resizable-window"
    116.             android:value="false" />
    117.  
    118.         <provider
    119.             android:name="androidx.startup.InitializationProvider"
    120.             android:exported="false"
    121.             android:authorities="com.my.game.androidx-startup">
    122.  
    123.             <meta-data
    124.                 android:name="com.unity3d.mediation.unityadsadapter.UnityAdsModuleInitializer"
    125.                 android:value="androidx.startup" />
    126.  
    127.             <meta-data
    128.                 android:name="com.unity3d.mediation.UnityMediationSDKModuleInitializer"
    129.                 android:value="androidx.startup" />
    130.  
    131.             <meta-data
    132.                 android:name="com.unity3d.services.identifiers.UnitySharedLibraryInitializer"
    133.                 android:value="androidx.startup" />
    134.         </provider>
    135.  
    136.         <activity
    137.             android:theme="@ref/0x01030007"
    138.             android:name="com.unity3d.services.ads.adunit.AdUnitActivity"
    139.             android:configChanges="0x40000fff"
    140.             android:hardwareAccelerated="true" />
    141.  
    142.         <activity
    143.             android:theme="@ref/0x01030011"
    144.             android:name="com.unity3d.services.ads.adunit.AdUnitTransparentActivity"
    145.             android:configChanges="0x40000fff"
    146.             android:hardwareAccelerated="true" />
    147.  
    148.         <activity
    149.             android:theme="@ref/0x01030011"
    150.             android:name="com.unity3d.services.ads.adunit.AdUnitTransparentSoftwareActivity"
    151.             android:configChanges="0x40000fff"
    152.             android:hardwareAccelerated="false" />
    153.  
    154.         <activity
    155.             android:theme="@ref/0x01030007"
    156.             android:name="com.unity3d.services.ads.adunit.AdUnitSoftwareActivity"
    157.             android:configChanges="0x40000fff"
    158.             android:hardwareAccelerated="false" />
    159.  
    160.         <activity
    161.             android:theme="@ref/0x01030010"
    162.             android:name="com.google.android.gms.common.api.GoogleApiActivity"
    163.             android:exported="false" />
    164.  
    165.         <meta-data
    166.             android:name="com.google.android.play.billingclient.version"
    167.             android:value="4.0.0" />
    168.  
    169.         <activity
    170.             android:theme="@ref/0x01030010"
    171.             android:name="com.android.billingclient.api.ProxyBillingActivity"
    172.             android:exported="false"
    173.             android:configChanges="0x5b0" />
    174.  
    175.         <service
    176.             android:name="com.google.android.gms.nearby.exposurenotification.WakeUpService"
    177.             android:permission="com.google.android.gms.nearby.exposurenotification.EXPOSURE_CALLBACK"
    178.             android:exported="true" />
    179.  
    180.         <receiver
    181.             android:name="com.amazon.device.iap.ResponseReceiver"
    182.             android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY"
    183.             android:exported="true">
    184.  
    185.             <intent-filter>
    186.  
    187.                 <action
    188.                     android:name="com.amazon.inapp.purchasing.NOTIFY" />
    189.             </intent-filter>
    190.         </receiver>
    191.  
    192.         <activity
    193.             android:theme="@ref/0x7f0c0007"
    194.             android:name="com.google.android.play.core.common.PlayCoreDialogWrapperActivity"
    195.             android:exported="false"
    196.             android:stateNotNeeded="true" />
    197.  
    198.         <activity
    199.             android:theme="@ref/0x01030010"
    200.             android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
    201.             android:exported="false"
    202.             android:excludeFromRecents="true" />
    203.  
    204.         <service
    205.             android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
    206.             android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION"
    207.             android:exported="true"
    208.             android:visibleToInstantApps="true" />  //[B]line 208, is error here? (according to play validation)[/B]
    209.  
    210.         <meta-data
    211.             android:name="com.google.android.gms.version"
    212.             android:value="@ref/0x7f070000" />
    213.  
    214.         <provider
    215.             android:name="androidx.lifecycle.ProcessLifecycleOwnerInitializer"
    216.             android:exported="false"
    217.             android:multiprocess="true"
    218.             android:authorities="com.my.game.lifecycle-process" />
    219.  
    220.         <activity
    221.             android:theme="@ref/0x7f0c0008"
    222.             android:name="com.voxelbusters.android.essentialkit.features.notificationservices.NotificationLauncher"
    223.             android:exported="true" />
    224.  
    225.         <provider
    226.             android:name="com.voxelbusters.android.essentialkit.common.FileProviderExtended"
    227.             android:exported="false"
    228.             android:authorities="com.my.game.essentialkit.fileprovider"
    229.             android:grantUriPermissions="true">
    230.  
    231.             <meta-data
    232.                 android:name="android.support.FILE_PROVIDER_PATHS"
    233.                 android:resource="@ref/0x7f0e0000" />
    234.         </provider>
    235.  
    236.         <receiver
    237.             android:name="com.voxelbusters.android.essentialkit.features.notificationservices.AlarmBroadcastReceiver" />
    238.  
    239.         <receiver
    240.             android:name="com.voxelbusters.android.essentialkit.features.notificationservices.BootCompleteBroadcastReceiver"
    241.             android:exported="true">
    242.  
    243.             <intent-filter>
    244.  
    245.                 <category
    246.                     android:name="android.intent.category.DEFAULT" />
    247.  
    248.                 <action
    249.                     android:name="android.intent.action.BOOT_COMPLETED" />
    250.  
    251.                 <action
    252.                     android:name="android.intent.action.QUICKBOOT_POWERON" />
    253.  
    254.                 <action
    255.                     android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
    256.             </intent-filter>
    257.         </receiver>
    258.  
    259.         <meta-data
    260.             android:name="com.google.android.gms.games.APP_ID" />
    261.     </application>
    262. </manifest>
    263.  
     
    Last edited: Nov 8, 2022
  36. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    Not sure but the error might be in this line. Can you try adding a direct version value here instead of ref and give a try. I'm not 100% sure if this is the issue but a wild guess. There is no enough info in the error log shared.
     
  37. John_magana

    John_magana

    Joined:
    Mar 18, 2022
    Posts:
    1
    This does look like it would work, but the #if UNITY_EDITOR && UNITY_ANDROID is making everything gray, is this right?
     
  38. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    That sounds to me like you haven't set Android as your build target.
     
  39. dezzell

    dezzell

    Joined:
    Feb 7, 2015
    Posts:
    32
    This fixed my issue using the code above within AndroidManifestPostProcessor.cs under editor folder. I went to upload an update on Google Play last night, told me version 30 is obsolete, I changed minimum version to 31, attempted to use 33 as highest version, and kept getting an error in Java Player after build, so switched highest to 32, minimum to 31. Then got the error on Google Play about intent, services, activities and android:exported = "true", went through many articles, and this one did the trick. Did not have to tweak the code, just copied the code to the editor folder, did a new build, and it worked when I uploaded to Google Play. I am on 2020.3.16f for this project.

    For those who need to update Android SDK for Unity, I used Android Studio, however it just updated under Studio, which Unity3D is using it's own SDK folders, I copied the folders from Studio platform to Unity3D platform folder, thou had issues with Java Player.

    So I found this Windows CMD line which updated Android in the Unity3D SDK folders.

    Open CMD from run or search CMD, run as Administrator, may work without, and update the path below to your JDK and SDK folders. Something wrong with version 33. So if you get a Java Player error after build, use max level 32.

    When I went to Build with 31 selected, a msg came up to update during build, but it generated an error, so the commands below downloaded the updates for Android.

    c:
    set JAVA_HOME=C:\Program Files\Unity\Hub\Editor\2020.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\
    set ANDROID_HOME=C:\Program Files\Unity\Hub\Editor\2020.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\
    cd %ANDROID_HOME%SDK\tools\bin\
    echo.> %USERPROFILE%\.android\repositories.cfg

    cmd /C sdkmanager --update
    cmd /C sdkmanager "platform-tools" "platforms;android-31"
    cmd /C sdkmanager "platform-tools" "platforms;android-32"
    cmd /C sdkmanager "platform-tools" "platforms;android-33"


    Enjoy your time and keep creating amazing works of art :)
     
    Voxel-Busters likes this.
  40. Roxo_Admin

    Roxo_Admin

    Joined:
    Oct 15, 2020
    Posts:
    1


    Steps to resolve this solution:

    Hi Guys, I find this generic solution for this problem and I hope it will for everyone as well.

    Please follow each steps carefully in order to resolve this issue.

    There are two major steps for this

    Step 1:

    * You can skip step 1 If you already update your SDK target level.

    1.0: First you have to update your SDK target API level to 31,32 or 33 (any one)

    1.1: Once you update it then go to > Edit > project settings >Player, then click on Other Settings and on the drop down menu of Target API Level select “Automatic (Highest installed)”


    upload_2022-12-10_11-53-33.png upload_2022-12-10_11-53-48.png



    Then Follow this Steps 2:


    2.0: go to > Edit > project settings >Player, then click on Publishing Settings and click on “Custom Main Manifest” Check box. It will create AndroidManifest.xml file the location as you see in below picture. Open this AndroidManifest.xml file in any editor.

    upload_2022-12-10_11-54-24.png


    2.1: Then you have to build you app once (means make .aab or apk file).

    2.2: After that in the unity right click on Assets and click on this option “Show in Explorer”

    2.3: Then follow this directory for your project “E:\Wasim\ROXO\HasteKing 1.05\Temp\gradleOut\launcher\build\intermediates\bundle_manifest\release\bundle-manifest “ here you will see other AndroidManifest.xml file just open it in any editor.

    2.4: Copy the all the code and paste it into Custom Main Manifest Xml file that we created in step 2.0 . Once you paste all the code then you have to put the android:exported=”true” tag on that components where you will not find this tag. for example, in Activity, Service or Application components.

    2.5: Then save it and build the final .aab for your app I hope it will 110% work for your cases as well.
     
  41. prabeshpathak02

    prabeshpathak02

    Joined:
    Aug 2, 2021
    Posts:
    3
    Hello i am having similar issues here. I havent tried the script above but should i update my firedbase plugins? i really dont know stuff abt android
     
  42. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    If the issue is related to export flags, try updating the plugins to latest. However, without any error logs or merged manifest or sample apk, I can't suggest any.
     
  43. VoldemortEatsBurgers

    VoldemortEatsBurgers

    Joined:
    Jun 28, 2021
    Posts:
    6
    Hi all! I also encountered the problem described above. All the solutions that I saw in the discussions of this problem did not help me. The source of the problem was the Unity Mobile Notifications plugin.
    I was helped by updating this plugin to the latest version. If the source of your problem is the same as mine, go to the Package Manager, find this plugin and update. Do the build itself NOT with a custom manifest.
    Good luck and I hope my advice helps someone! :)
    Note: my version of Unity is 2021.2.5f1
     
  44. hafuumahmood

    hafuumahmood

    Joined:
    Jul 27, 2018
    Posts:
    5
    Hi there. I have the same issue. I have followed all the steps above but cannot publish the update of my app to the store. Please help me. I am really really frustrated.
     
  45. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,966
    Share either the final merged AndroidManifest.xml file or an empty apk without any scenes from your project to look into.
     
  46. kumaristudio

    kumaristudio

    Joined:
    Dec 2, 2020
    Posts:
    1

    Thanks so much, it worked for me, i had to take multiple builds and solving line by line, but it worked...
     
  47. Flowboxing

    Flowboxing

    Joined:
    May 15, 2023
    Posts:
    1
     
  48. gvaxtv

    gvaxtv

    Joined:
    Jan 8, 2018
    Posts:
    5
    Hello!
    My turn to try to update our App to be able to publish it on Play Store for Android 12.
    I spend 15 hours trying everything that I read on this thread, with no luck.
    My last App version was developed on Unity 2018.4.36 so I just updated to 2019.1.0f1 because you said that this solved your problem.
    It does not seem to solve mine. Maybe I need another version. Can you let me know which version of 2019 is working for you?

    Many thanks
     
    Last edited: Jun 6, 2023
  49. gvaxtv

    gvaxtv

    Joined:
    Jan 8, 2018
    Posts:
    5
    Hello Roxo,
    continuing my questions. I would like to try your solution, but at the moment I have upgreaded to version 2019.1.0f1 and I don't have the option to create that custom manifest file. Do you happen to know which version of Unity introduced that option to create the custom manifest. I'm trying to stay as close to the version I have because going to far up will break for sure all my scripts. Thanks for your help
     
  50. JakeUpfront

    JakeUpfront

    Joined:
    Jan 15, 2021
    Posts:
    1
    Voxel-Busters, I just wanted to thank you for providing the solution. I have been struggling with this issue for days. Thank you!!!!
     
    Voxel-Busters likes this.