diff --git a/.changeset/wet-impalas-push.md b/.changeset/wet-impalas-push.md new file mode 100644 index 00000000..06d048b9 --- /dev/null +++ b/.changeset/wet-impalas-push.md @@ -0,0 +1,5 @@ +--- +"@react-native-documents/viewer": patch +--- + +fix(android): couldn't find meta-data for provider diff --git a/packages/document-viewer/android/src/main/java/com/reactnativedocumentviewer/RNDocumentViewerModule.kt b/packages/document-viewer/android/src/main/java/com/reactnativedocumentviewer/RNDocumentViewerModule.kt index 29f6d013..e486a221 100644 --- a/packages/document-viewer/android/src/main/java/com/reactnativedocumentviewer/RNDocumentViewerModule.kt +++ b/packages/document-viewer/android/src/main/java/com/reactnativedocumentviewer/RNDocumentViewerModule.kt @@ -62,8 +62,8 @@ class RNDocumentViewerModule(reactContext: ReactApplicationContext) : NativeDocu UriWithFlags(Uri.parse(bookmarkOrUri), flags) } else if (bookmarkOrUri.startsWith("file://")) { val uri = Uri.parse(bookmarkOrUri) - // TODO package name may not be the same as applicationId - val authority = reactApplicationContext.packageName + ".provider" + // TODO package name may not be the same as applicationId. Also see document-viewer/android/src/main/AndroidManifest.xml + val authority = reactApplicationContext.packageName + ".reactnativedocumentviewer.provider" val uriPath = uri.path ?: throw IllegalArgumentException("file:// uri must have a path") val fileUri = FileProvider.getUriForFile( reactApplicationContext,