- Home /
Can anyone help me place android:allowBackup=“false” in the manifest
Basically, I want my saved data to reset when users uninstall the game, however at the moment it's grabbing a backup it has whenever I do so.
I've tried to put it here. But it doesn't seem to work. This is in my Android manifest from Plugins/Android/GoogleMobileAdsPlugin/
<?xml version="1.0" encoding="utf-8"?>
<!--
This Google Mobile Ads plugin library manifest will get merged with your
application's manifest, adding the necessary activity and permissions
required for displaying ads.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.unity.ads"
android:versionName="20"
android:versionCode="20">
<uses-sdk android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application>
<uses-library android:required="false" android:name="org.apache.http.legacy"/>
<!-- Your AdMob App ID will look similar to this sample ID: -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value=""
android:allowBackup="false"/>
</application>
<uses-permission android:name="com.android.vending.BILLING" />
</manifest>
Still need help on this matter, please see comment I left on post below.
Answer by Bunny83 · Jun 23, 2019 at 10:07 PM
The allowBackup attribute is an attribute of the "application" node. You added it to the sub node meta-data. Just read the documentation
Put it there, It then told me it's already present in the one its trying to merge with. I googled how to add the replace tools and to put it where it should go but it's still saying its conflicting?
<?xml version="1.0" encoding="utf-8"?>
<!--
This Google $$anonymous$$obile Ads plugin library manifest will get merged with your
application's manifest, adding the necessary activity and permissions
required for displaying ads.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.unity.ads"
android:versionName="21"
android:versionCode="21">
<uses-sdk android:$$anonymous$$SdkVersion="14"
android:targetSdkVersion="19" />
<application android:allowBackup="false"
tools:replace="android:allowBackup">
<uses-library android:required="false" android:name="org.apache.http.legacy"/>
<!-- Your Ad$$anonymous$$ob App ID will look similar to this sample ID: -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value=""/>
</application>
<uses-permission android:name="com.android.vending.BILLING" />
</manifest>
Console still stating $$anonymous$$gestion: add 'tools:replace="android:allowBackup"' to element at Android$$anonymous$$anifest.xml:4:3-17:17 to override.
Well, you seem to have multiple manifest files which get merged when you build your app. Frameworks should not define thie attribute at all. However it's possible that you use any kind of plugin that comes with a manifest which defines this attribute. So just check all your manifest files.
I found the merged one by searching my files, which does in fact have the "true" value im trying to change, Don't suppose you know if i am able to edit this one? \Temp\gradleOut\build\intermediates\merged_manifests\release\processRelease$$anonymous$$anifest\merged I know some get generated when you build, Searched all of the manifest files i have and only this one has that value in it. I'm pretty sure only way to test it is to actually release it which will take a while, so just thought id ask
Console is refering to Attribute application@allowBackup value=(true) from [:GooglePlay:] Android$$anonymous$$anifest.xml:22:18-44
Cant seem to find any reference to [:GooglePlay:] unity on google.
EDIT: just built and that value was set back to true, so something else must be messing with it.
Answer by Divinitize1 · Jun 24, 2019 at 04:05 PM
Still need assistance with this.
Here are some more details
Error window - Gradle Error: Colliding Attributes. The attribute application@allowBackup=true in :GoogleMobileAdsPlugin collides with another value (see console for details)
The console then goes on to tell me that I should try adding tools:replace="android:allowBackup" to the manifest. I have done so, it's in the correct spot, so is the link to the tools.
I don't understand how it's saying :GoogleMobileAdsPlugin collides with another value Because the manifest I am editing is from Plugins/Android/GoogleMobileAdsPlugin I have checked every other manifest file that is inside my project and the only one which shows android:allowBackup="true" which is what i want to replace with false, is in the final manifest that gets created after a build.
So the 2 questions are, why isn't the tools:replace working and/or what is setting the value to true that isn't coming from a manifest file. Have found google results regarding all of this, none of which relate to unity and only for Android developers directly.
Your answer
Follow this Question
Related Questions
Google Cloud PlayerPrefs Plugin 0 Answers
What triggers the Internet Access permission, when it's set to auto on Android? 1 Answer
How to Merge prime31's manifest xml and vuforia's manifest xml ? 0 Answers
Unity Android Service Not Running 0 Answers
AndroidManifest-main error when exporting project on another PC. 0 Answers