How to clear data when the application is uninstalled?


#1

Hi all.

I have an app with a login part, I save all my data with appSettings and databases. But if the user uninstall the app, all data persists .

How to clear data when the application is uninstalled?
Or I need to make a variable, maybe isfirstTime clear all?

Thanks


#2

Set android:allowBackup=“false” on you application element in your manifest file.


#3

Hi

When I set to false, I have an error:

> Manifest merger failed : Attribute application@allowBackup value=(false) from
AndroidManifest.xml:27:3-30 is also present at [:Common-2017.1.719-dev-release:] AndroidManifest.xml:11:18-44 value=(true).
        Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:25:2-55:16 to override.

And if I put the tools:replace to application I have other error with the association.

And if I put that

  xmlns:tools="http://schemas.android.com/tools"
              tools:replace="allowBackup"
              android:allowBackup="false"/>

in manifest

I don’t have errors, but the APP still save the data.


#4

Are you sure you do follow the right syntax in right file, it worked for me.


#5

Yes

in app/App_Resources/Android/AndroidManifest.xml

But if I change it to false, I have the error.

Maybe because the application is already signed?

Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:25:2-55:16 to override.

Thanks


#6

Maybe if I remove the Android platform?

this does not affect if it is already signed and in store?


#7

Hi again.

I have the solution.

in

android:allowBackup="false"
   tools:replace="android:allowBackup"

And in the Manifest section

 xmlns:tools="http://schemas.android.com/tools"

Thanks