Unity 2019.4.10f1 LTS - Android Permissions crashing app on startup

Hi folks,
I’m currently getting the following issues:

  1. I build my game targeting API level 29 and run it on my pixel 3.
  2. When opening my game for the first time after a fresh install, I’m prompted for “Files and media” permission. This is expected given I save the player’s high score to disk
  3. After accepting the permissions, the app crashes.
  4. Re-opening the app starts the game as expected, with permissions intact.

Anyone having similar issues?

Here’s my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
  <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" android:debuggable="false">
    <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>

Hey, could you please attach logcat, it might contain information about exactly what went wrong. Thanks.

You can use https://docs.unity3d.com/Packages/com.unity.mobile.android-logcat@1.2/manual/index.html to easily get logs from the device.

Thanks for the logcat tip!

Here’s a video of what the crash looks like
cloudyskeletalgoitered

I attached the logs as debug_log.txt :slight_smile:

6428135–718859–debug_logs.txt (14.1 KB)

The logcat doesn’t indicate a crash, in fact Unity did even output memory statistics, which happens only whe Unity quits normally.

Does the same happens with empty project?

A longshot, but I think I saw something similar, when Android Studio’s Layout inspector is used, by any chance do you have Layout Inspector opened in Android Studio?

Small update on this issue - I ended up realizing I didn’t need the external storage permissions hence turned them off.

As follow up on your suggestions - it did happen with an empty project with “write Permission” set to “External (SD Card)”. Moreover, I didn’t have the Android Studio’s Layout inspector open!

I don’t think I have an SD card on my phone - perhaps it crashed due to that?