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

rn-pdf-reader-js not working with react native expo SDK 49 in android. #200

Closed
kirtikapadiya opened this issue Jan 24, 2024 · 9 comments
Closed

Comments

@kirtikapadiya
Copy link

kirtikapadiya commented Jan 24, 2024

PDF reader not working after updating expo SDK 48 to expo SDK 49 in android device.

Reproducible snack link : https://snack.expo.dev/@kirtikk/pdfreader-expo-49
same issue : #15

  • Nodejs version: 18.12.0
  • React version: 18.2.0
  • React Native version: 0.72.6
  • rn-pdf-reader-js version: 4.1.1
  • Platform(s) (iOS, Android, or both?): both
  • Expo version: 49.0.0

Error : Cannot convert null value to object

@kirtikapadiya kirtikapadiya changed the title rn-pdf-reader not working with react native expo SDK 49 in android. rn-pdf-reader.js not working with react native expo SDK 49 in android. Feb 1, 2024
@kirtikapadiya kirtikapadiya changed the title rn-pdf-reader.js not working with react native expo SDK 49 in android. rn-pdf-reader-js not working with react native expo SDK 49 in android. Feb 1, 2024
@MateusArenas
Copy link

try this to resolve:

import PDFReader, { Props } from 'rn-pdf-reader-js'

class MyPDFReader extends PDFReader {
  constructor(props: Props | Readonly<Props>) {
    super(props);
    this.state = { ...this.state, renderedOnce: true };
  }
}

....

return (
   <MyPDFReader 
       source={{ uri: uri }}
       ....
   />
)

@kirtikapadiya
Copy link
Author

try this to resolve:

import PDFReader, { Props } from 'rn-pdf-reader-js'

class MyPDFReader extends PDFReader {
  constructor(props: Props | Readonly<Props>) {
    super(props);
    this.state = { ...this.state, renderedOnce: true };
  }
}

....

return (
   <MyPDFReader 
       source={{ uri: uri }}
       ....
   />
)

not working

@kirtikapadiya
Copy link
Author

Anyways I used another package react-native-pdf for view/render PDF.

@MarcoGennaro
Copy link

I have the same problem reported on this issue, there is any solution?

@id-linksoluciones
Copy link

Anyways I used another package react-native-pdf for view/render PDF.

Can you tell us what package you used, please?

@MarcoGennaro
Copy link

It's called exactly react-native-pdf, i replace it too in my project with success.
the only problem is that doesn't work with expo go and to test the page where it is used you had to do a development build.

@ErickNuup
Copy link

try this to resolve:

import PDFReader, { Props } from 'rn-pdf-reader-js'

class MyPDFReader extends PDFReader {
  constructor(props: Props | Readonly<Props>) {
    super(props);
    this.state = { ...this.state, renderedOnce: true };
  }
}

....

return (
   <MyPDFReader 
       source={{ uri: uri }}
       ....
   />
)

This resolve problem expo SDK 50

@j-q-in-berlin
Copy link

I get the error directly after running "npm install rn-pdf-reader-js". The proposed solutions don't work in my case. Anyone else had the same problem?

@oussamanm
Copy link

oussamanm commented Dec 19, 2024

try this to resolve:

import PDFReader, { Props } from 'rn-pdf-reader-js'

class MyPDFReader extends PDFReader {
  constructor(props: Props | Readonly<Props>) {
    super(props);
    this.state = { ...this.state, renderedOnce: true };
  }
}

....

return (
   <MyPDFReader 
       source={{ uri: uri }}
       ....
   />
)

@MateusArenas
its worked after hours of errors , Thanks bro

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

7 participants