Search Unity

Question Android app opens "App Info" instead of launching app

Discussion in 'Android' started by Lozzzyy, Oct 7, 2021.

  1. Lozzzyy

    Lozzzyy

    Joined:
    Jul 31, 2020
    Posts:
    9
    My APK can be built, copied over to my phone via USB, and installed with no problems. If I run the app immediately after it installs (from the window with the options "Done" and "Open"), it works fine.



    However, if I try and load the app after installing it, the App Info window comes up instead of launching the app. From the times I installed and ran my app everything works exactly as expected.

    Here is my AndroidManifest.xml (auto-generated custom manifest from publishing settings), I've done some looking around and the few things I saw said my intent filters might not be set up correctly. I think I have an idea of what they do and have spent some time trying different things, but I'm more or less stabbing in the dark:

    Code (xml):
    1.  <?xml version="1.0" encoding="utf-8"?>
    2. <!-- GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN-->
    3. <manifest
    4.      xmlns:android="http://schemas.android.com/apk/res/android"
    5.      package="com.unity3d.player"
    6.      xmlns:tools="http://schemas.android.com/tools">
    7.      <application>
    8.          <activity android:name="com.unity3d.player.UnityPlayerActivity"
    9.                    android:theme="@style/UnityThemeSelector">
    10.              <intent-filter>
    11.                <category android:name="android.intent.category.LAUNCHER" />
    12.                <action android:name="android.intent.action.MAIN" />
    13.              </intent-filter>
    14.              <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    15.          </activity>
    16.      </application>
    17. </manifest>
    I'm not very experienced in the specifics of Android development, only really interact with stuff like this in the context of building Unity apps. Is there anything in this manifest that would lead to my app having its main activity set to load the app info page? Any pointers would be greatly appreciated.
     
  2. Lozzzyy

    Lozzzyy

    Joined:
    Jul 31, 2020
    Posts:
    9
    for the love of god please help me
     
  3. Lozzzyy

    Lozzzyy

    Joined:
    Jul 31, 2020
    Posts:
    9
    Some of the more SUS lines I've found using logcat

    Info ActivityTaskManager START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 hwFlg=0x10 cmp=com.Company.VR/android.app.AppDetailsActivity bnds=[42,118][294,423]} from uid 10067


    Info ActivityTaskManager START u0 {act=android.settings.APPLICATION_DETAILS_SETTINGS hwFlg=0x10 cmp=com.android.settings/.applications.InstalledAppDetails} from uid 10265


    Any ideas where the APPLICATION_DETAILS_SETTINGS is coming from? I've searched my project and manifest files and none of them point to this intent.
     
    Last edited: Oct 15, 2021
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    When looking at the manifest, try looking at the final one, meaning take an apk file drag and drop it in Android Studio and inspect the manifest.
     
    Lozzzyy likes this.
  5. Lozzzyy

    Lozzzyy

    Joined:
    Jul 31, 2020
    Posts:
    9
    Thank you! I found that, for whatever reason, this manifest decided to create this intent filter, which I believe is the culprit. Checked some other apps I built recently and none of them had this problem, very strange.


    Only thing now is I get this on the top <manifest> line with the version info/sdk versions:

    Error:External resource http://schemas.android.com/apk/res/android is not registered


    It doesn't look like android studio will let me save my changes until all my errors are fixed?
     
  6. Lozzzyy

    Lozzzyy

    Joined:
    Jul 31, 2020
    Posts:
    9
    OK SO I HAVE SOLVED THE ISSUE, THANK YOU ;_;

    The project we are using is made to be multi-platform, we swap around to build stuff to mobile using AR, and PC using VR. In an Oculus script called OvrGradleGeneration.cs is this line (commented out):



    So it turns out, even though I had Oculus disabled in my XR plugin management, it was still managing to get into my build and change my launcher intent.
     
    Tomas1856 likes this.
  7. Lozzzyy

    Lozzzyy

    Joined:
    Jul 31, 2020
    Posts:
    9
    Unrelated to this specific issue but have had multiple other problems popping up with regards to OvrGradleGeneration.cs.

    This file LOVES adding random things to your manifest that you don't expect. It was manually adding "android.hardware.vr.headtracking" to my manifest, taking my compatible devices on the play store from ~200, to 4.

    So if you have a problem with your build/getting it to work on certain devices, check your manifest for unwanted lines and check if this class is the culprit.

    I have Oculus unchecked in my XR plugin management settings so it's very confusing why Unity is still asking for its opinion when building.