Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug] Crash when downloading Image #6439

Closed
csadilek opened this issue Nov 4, 2019 · 8 comments
Closed

[Bug] Crash when downloading Image #6439

csadilek opened this issue Nov 4, 2019 · 8 comments
Assignees
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info 🐞 bug Crashes, Something isn't working, .. E8 Estimation Point: about 8 days eng:qa:verified QA Verified Feature:Download needs:ac Needs Android Component Work P1 Current sprint

Comments

@csadilek
Copy link
Contributor

csadilek commented Nov 4, 2019

We're getting this new relatively frequent crash:
https://sentry.prod.mozaws.net/operations/fenix-nightly/issues/6580864/

java.lang.IllegalArgumentException: Failed to find configured root that contains ...
    at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:15)
    at mozilla.components.feature.prompts.MimeType$Image$1.invoke(MimeType.kt:2)
    at mozilla.components.feature.prompts.MimeType$Image.buildIntent(MimeType.kt:5)
    at mozilla.components.feature.prompts.FilePicker.handleFileRequest(FilePicker.kt:19)
    at mozilla.components.feature.prompts.PromptFeature.onPromptRequested$feature_prompts_release(PromptFeature.kt:4)
    at mozilla.components.feature.prompts.PromptFeature$start$1$invokeSuspend$$inlined$collect$1.emit(Collect.kt:7)
    at mozilla.components.support.ktx.kotlinx.coroutines.flow.FlowKt$ifAnyChanged$$inlined$filter$1$2.emit(Collect.kt:15)
    at mozilla.components.feature.prompts.PromptFeature$start$1$invokeSuspend$$inlined$map$1$2.emit(Collect.kt:5)

┆Issue is synchronized with this Jira Task

@csadilek csadilek added 🐞 bug Crashes, Something isn't working, .. b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info labels Nov 4, 2019
@sblatz sblatz self-assigned this Nov 4, 2019
@sblatz sblatz added the P1 Current sprint label Nov 4, 2019
@sblatz sblatz added Feature:Download needs:ac Needs Android Component Work labels Nov 11, 2019
@sblatz sblatz removed their assignment Nov 12, 2019
@jonalmeida jonalmeida assigned Amejia481 and sblatz and unassigned sblatz Nov 12, 2019
@sblatz
Copy link
Contributor

sblatz commented Nov 12, 2019

This may be fixed in the newest version of AC, but we haven't gotten new snapshot for Fenix, so maybe it's just because we haven't gotten a new snapshot.

@cpeterso
Copy link

cpeterso commented Nov 13, 2019

Corresponding Bugzilla bug filed from crash-stats: https://bugzilla.mozilla.org/show_bug.cgi?id=1595804

@sblatz
Copy link
Contributor

sblatz commented Nov 13, 2019

Let's keep a pulse on this over the next few days but it seems to have disappeared?

@Amejia481
Copy link
Contributor

Amejia481 commented Nov 14, 2019

I think the issue is still there, I able to reproduce it on master, the issue happens when the input has an image mime type.

STR:

  1. Go https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file
  2. Toggle Desktop site (to be set ON).
  3. Tap browser button below the label "Choose a profile picture".

I'm taking a look to how to fix it. I will keep you update.

@Amejia481
Copy link
Contributor

I think the main issue rely on feature-prompts and Fenix providers has the same authorities properties: android:authorities="${applicationId}.fileprovider"

Feature prompts
https://github.com/mozilla-mobile/android-components/blob/master/components/feature/prompts/src/main/AndroidManifest.xml

        <provider
            android:authorities="${applicationId}.fileprovider"
            android:name="androidx.core.content.FileProvider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>

Fenix

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>

@Amejia481
Copy link
Contributor

Found the source of the issue the android:name="androidx.core.content.FileProvider" property is the same is both case and it should be unique.

@Amejia481
Copy link
Contributor

Amejia481 commented Nov 20, 2019

This will fixed after #6699 lands

@sblatz sblatz added the eng:qa:needed QA Needed label Nov 22, 2019
@lobontiumira
Copy link

Verified as fixed on the latest Nightly 11/25 (#13290608) with Google Pixel 3 (Android Q), and Huawei P9 Lite (Android 7).

@lobontiumira lobontiumira added eng:qa:verified QA Verified and removed eng:qa:needed QA Needed labels Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info 🐞 bug Crashes, Something isn't working, .. E8 Estimation Point: about 8 days eng:qa:verified QA Verified Feature:Download needs:ac Needs Android Component Work P1 Current sprint
Projects
None yet
Development

No branches or pull requests

5 participants