0

I'm having an issue with the android https://developer.android.com/guide/topics/data/autobackup feature not working. Unity version; 2018.4.3f1 Android; min version: 16, target: 28

I've tried it with the 'android:fullBackupOnly' flag, but it made no difference either.

  • It won't retain anything in Playerprefs upon uninstall.
  • It won't retain anything when manually saving it in the native android sharedPreferences and uninstalling.
  • Builds have been created using the same bundle identifier as used for our store product.
  • We force our backups by manually triggering the google drive backup on the phone to ensure it attempted to do the backup.
  • We have multiple manifests which get merged together, but we've looked in our final merged manifest and it is still the same as shown in the example above.
  • Tested on phones which are above android 6.0 which is the requirement according to the documentation.
  • Builds got distributed across appcenter. I'm not sure if it needs to be distributed through specific channels before it starts working?

Partial manifest which includes the allowBackup flag;

<application android:allowBackup="true" android:icon="@drawable/app_icon" android:label="@string/app_name" android:largeHeap="true" android:theme="@style/UnityThemeSelector" android:resizeableActivity="false"
android:isGame="true" android:banner="@drawable/app_banner" android:networkSecurityConfig="@xml/network_security_config">
        <!-- Required for "super widescreen" devices -->
        <meta-data android:name="android.max_aspect" android:value="3.0" />
        <activity android:label="@string/app_name" android:name=REDACTED android:screenOrientation="sensorPortrait" android:launchMode="singleTop" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:clearTaskOnLaunch="false">
            <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
            <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>
        </activity>
</application>

If anyone has any idea I'd greatly appreciate it, because I'm at a bit of a loss here.

1 Answers1

1

So in the end it was a quota issue. For anyone who kind of missed the documentation like I did, here are easy steps to determine what error you're dealing with;

https://developer.android.com/studio/command-line/adb.html

  1. navigate to your android SDK folder.
  2. open a shell/cmd window.
  3. List the packages installed on your device, to get the package which you're expecting to perform an autobackup " .\adb shell pm list packages -f ".
  4. Open LogCat to get the full debug.
  5. Test ADB auto backup .\adb shell bmgr backupnow "PACKAGE_NAME"
  6. Read output in shell/cmd and logcat to determine issue.

Good luck :).