-
Notifications
You must be signed in to change notification settings - Fork 549
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
Why we cannot require for android? #21
Comments
Do you mean |
Thanks for the reply . Have to put pdf files in android's asset folder or i can put it anywhere. |
if you use {uri:"bundle-assets://path/to/xxx.pdf"} |
so we should keep two copy of pdf ? |
In source, you can keep two copy of pdf for android and iOS, If you want to use one copy in source, you can keep android copy, and add it to iOS by reference. |
i use let source = {uri:'bundle-assets://path/to/QXTTV.pdf'}; app crash error msg is /ReactNativeJS: undefined is not a function (evaluating 'l.default.fs.cp(r,n).progress(function(e,r){o.props.onLoadProgress&&o.props.onLoadProgress(e/r),o.setState({progress:e/r})})') when i use let source = {uri:'https://www.irs.gov/pub/irs-pdf/fw2.pdf',cache:true}; it ok ,what happen? please help me think you! |
"path/to/QXTTV.pdf" should be real assets path in your source under android/app/src/main/assets/ |
it s not working for me, any help?, i'm trying to make it work on android, i tried all the ways, and in all ways didnt work, |
If you have the pdf file at "android/app/src/main/assets/pdf/userGuide.pdf", |
i copy the exactly code from documentation i tried also doing let source = {uri:'bundle-assets://pdf/userGuide.pdf'}. My version is "react-native-pdf": "^1.0.5", "react": "15.3.2", |
"uri:'bundle-assets://", was added at react-native-pdf ver 1.0.6, you can see the detail release notes at here |
thanks for the fast feedback I upgrade to 1.0.6 and the messaje now is "pdf has no proptype for native prop rctpdf.asset of native type string if you havent changed this prop yourself, this usually means that your versions of the native code and javascript code are out of sync. updating both should make this error go away". If i want to use the uri:FILE: |
It can not work. the "android/app/src/main/assets" is not real path in your system. |
i want to add the pdf in the App, it's here "home/me/android-app/js/components/help/userGuide.pdf". |
show the pdf in the App need "uri:'bundle-assets://", but it seems not work. |
Hi,
why require module doesn't support for android?
The text was updated successfully, but these errors were encountered: