Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with module when react-native run-android #132

Open
uendar opened this issue Jun 18, 2019 · 7 comments
Open

Error with module when react-native run-android #132

uendar opened this issue Jun 18, 2019 · 7 comments

Comments

@uendar
Copy link

uendar commented Jun 18, 2019

node_modules\react-native-doc-viewer\android\src\main\java\com\reactlibrary\FileProviderClass.java:3: error: package android.support.v4.content does
not exist
public class FileProviderClass extends android.support.v4.content.FileProvider {
^
C:\Users\EndarUliu\Desktop\H\node_modules\react-native-doc-viewer\android\src\main\java\com\reactlibrary\RNReactNativeDocViewerModule.java:34: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
^
C:\Users\EndarUliu\Desktop\H\node_modules\react-native-doc-viewer\android\src\main\java\com\reactlibrary\RNReactNativeDocViewerModule.java:338: error: cannot find symbol
Uri contentUri = FileProvider.getUriForFile(context, reactContext.getPackageName()+".docViewer_provider", result);
^
symbol: variable FileProvider
location: class RNReactNativeDocViewerModule.FileDownloaderAsyncTask
3 errors

@uendar uendar changed the title Task :react-native-doc-viewer:compileDebugJavaWithJavac FAILED Error with module when react-native run-android Jun 19, 2019
@javiersuazo
Copy link

I think this it's due the android x update. Facing the same problem.

@levenies
Copy link

levenies commented Jul 4, 2019

android x update , How to solve???

@aybarsyalcin
Copy link

hi, you can try
1. Convert your app to AndroidX via the standard AndroidX migration
2. npm install --save-dev jetifier
3. npx jetify
4. npx react-native run-android (your app should correctly compile and work)
5. Call npx jetify run in the postinstall target of your package.json (Any time your dependencies update you have to jetify again)

@zivchen
Copy link

zivchen commented Aug 14, 2019

@aybarsyalcin, it didnt work for me.
@javiersuazo @levenies did you found a solution?

@Base29
Copy link

Base29 commented Mar 3, 2020

having the same issue any solution for this?

@Grewer
Copy link

Grewer commented Mar 5, 2020

preBuild.doFirst {
    ant.replaceregexp(match: 'android.support.v4.content', replace: 'androidx.core.content', flags: 'g', byline: true)
            {
                fileset(dir: '../../node_modules/react-native-doc-viewer/android/src/main/java/com/reactlibrary/', includes: '*.java')
            }
}

Under android/app/build.gradle file

Add between android and dependencies

@pratius
Copy link

pratius commented Oct 25, 2021

@Grewer Thanks, you save lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants