Skip to content

Commit

Permalink
Missing android.support.FILE_PROVIDER_PATHS meta-data on some OEMs (#…
Browse files Browse the repository at this point in the history
…2952)

We (Microsoft Office apps) are seeing the following crashes in certain OEMs (biased toward Samsung)
Exception java.lang.RuntimeException: Unable to get provider com.reactnativecommunity.webview.RNCWebViewFileProvider: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data
  at android.app.ActivityThread.installProvider (ActivityThread.java:6840)
  at android.app.ActivityThread.installContentProviders (ActivityThread.java:6382)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6286)
  ...
Caused by java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data
  at androidx.core.content.FileProvider.d
  at androidx.core.content.FileProvider.h
  at androidx.core.content.FileProvider.e
  at androidx.core.content.FileProvider.attachInfoMAM
  ..

Upon further investigation, we found the hypothesis that some OEMs strip meta-data from the manifest (though we don't have any solid data to confirm).

This discussion is related : https://issuetracker.google.com/issues/237727754?pli=1
And this commit into AOSP : https://android-review.googlesource.com/c/platform/frameworks/support/+/1978527
  • Loading branch information
mganandraj committed Jun 1, 2023
1 parent 3928573 commit 75e7801
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.reactnativecommunity.webview;

import androidx.core.content.FileProvider;
import com.reactnativecommunity.webview.R;

/**
* Providing a custom {@code FileProvider} prevents manifest {@code <provider>} name collisions.
* <p>
* See https://developer.android.com/guide/topics/manifest/provider-element.html for details.
*/
public class RNCWebViewFileProvider extends FileProvider {

// This class intentionally left blank.

public RNCWebViewFileProvider() {
super(R.xml.file_provider_paths);
}
}

0 comments on commit 75e7801

Please sign in to comment.