Closed Bug 1807305 Opened 3 years ago Closed 3 years ago

UI tests fail on Android 11 with junit.framework.AssertionFailedError: Failed to grant permissions, see logcat for details

Categories

(Firefox for Android :: UI Tests, defect)

All
Android
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: cpeterson, Unassigned)

References

Details

From github: https://github.com/mozilla-mobile/fenix/issues/22649.

Steps to reproduce

  1. With a device running Android 11 (I used a Pixel 2)...
  2. Run ./gradlew connectedDebugAndroidTest

Expected behaviour

Tests pass

Actual behaviour

All tests fail with something like:

org.mozilla.fenix.screenshots.DefaultHomeScreenTest > privateBrowsingTest[Pixel 2 - 11] FAILED 
        junit.framework.AssertionFailedError: Failed to grant permissions, see logcat for details
        at junit.framework.Assert.fail(Assert.java:50)

The logcat says:

12-01 09:34:07.836 19782 19904 E GrantPermissionCallable: Permission: android.permission.WRITE_EXTERNAL_STORAGE cannot be granted!

It sounds like this may be related to the storage changes in Android 11.

Device name

No response

Android version

Android 11

Firefox release type

Firefox Nightly

Firefox version

up/main: 9fa9ae3375593e9f7bfd49e4449e5012b0c83d4f

Device logs

No response

Additional information

I don't think we experienced this in a new Android project so it's probably something specific to our Gradle build configuration.

This issue may have blocked our progress on successfully integrating Jetpack Benchmark. The follow-up is get it working is https://github.com/mozilla-mobile/fenix/issues/22480

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

@aaron, do you know if this was fixed after you work on upgrading to API 30?

Flags: needinfo?(atrain)

Yeah, adjusting permission requests was one of the steps involved in supporting API 30.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
Flags: needinfo?(atrain)
You need to log in before you can comment on or make changes to this bug.