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

Jetifier and react-native-file-viewer #58

Closed
sm2017 opened this issue Apr 29, 2020 · 1 comment
Closed

Jetifier and react-native-file-viewer #58

sm2017 opened this issue Apr 29, 2020 · 1 comment

Comments

@sm2017
Copy link

sm2017 commented Apr 29, 2020

vinzscam/react-native-file-viewer#78

I am using react-native-file-viewer@2.0.2 , AFAIK it migrated to Android X , my react native version is 0.62.2 and in gradle.properties I have

android.useAndroidX=true
android.enableJetifier=true

I package.json I have postinstall script "postinstall": "jetifier"

After installing react-native-file-viewer and running jetifier , it react-native-file-viewer code to android support

image

https://github.com/vinzscam/react-native-file-viewer/blob/master/android/src/main/java/com/vinzscam/reactnativefileviewer/RNFileViewerModule.java#L8

node_modules\react-native-file-viewer\android\src\main\java\com\vinzscam\reactnativefileviewer\RNFileViewerModule.java:57: error: cannot find symbol
        contentUri = FileProvider.getUriForFile(getCurrentActivity(), authority, newFile);
                                 ^
  symbol:   method getUriForFile(Activity,String,File)
  location: class FileProvider

If I remove jetifier from postinstall , react-native-file-viewer code is androidx but I have some android support modules and have to enable jetifier

I am using jetifier@1.6.5

@mikehardy
Copy link
Owner

should work, it's in the mapping https://github.com/mikehardy/jetifier/blob/master/mapping/androidx-class-mapping.csv#L1404

Something is wrong with your integration somehow. Should be noted that as of react-native 0.61 the CLI calls jetifier for you by default

If you can reproduce this with a fresh project from react-native init and post it up on github I can see what's going on

@sm2017 sm2017 closed this as completed Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants