gregko
gregko

Reputation: 5822

Android Environment.isExternalStorageLegacy() always return true

I build a small app, compiling it with compileSdkVersion 29, targetSdkVersion 29, in app's AndroidManifest.xml I either specify

android:requestLegacyExternalStorage="false"

or remove it completely. I uninstall the app from Android 10 emulator (latest version of emulator that comes with Android Studio). Then install and check Environment.isExternalStorageLegacy(); it always returns true. What am I missing?

Upvotes: 0

Views: 494

Answers (1)

gregko
gregko

Reputation: 5822

OK, found the reason: I AndroidManifest.xml I was also using:

android:sharedUserId="some.package.name.shared"
android:sharedUserLabel="@string/some_uuid_name"

and other legacy mode apps were still installed. Removing sharedUserId (or I guess, uninstalling other legacy apps that share the ID) fixes the problem.

Upvotes: 1

Related Questions