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

[iOS 12][react-native-pdf 5.1.5] - Crash when loading a pdf - potentially linked to jailbreaked devices #398

Open
abrel opened this issue Oct 5, 2019 · 0 comments

Comments

@abrel
Copy link

abrel commented Oct 5, 2019

What react-native version are you using?
0.59.10
What react-native-pdf version are you using?
5.1.5 (but got this crash on lower versions as well)
rn-fetch-blob is 0.10.13 as per the docs

What platform does your issue occur on? (android/ios/both)
ios only - 100% Iphone - 100% ios12
Interesting facts, according to crashlytics, 80% of the devices where the crash happens are jailbreaked ; not 100% though

Describe your issue as precisely as possible :

  1. Steps to reproduce the issue or to explain in which case you get the issue
    I cannot reproduce myself but I get > 100 crashs a day (circa 2% of my daily users) when opening a pdf
  2. Interesting logs
Crashed: com.apple.main-thread
0  karmaMobile                    0x1009043b0 -[RCTPdfView init] + 700324
1  karmaMobile                    0x100903a08 -[RCTPdfViewManager view] + 697852
2  karmaMobile                    0x100979ca8 -[RCTComponentData createViewWithTag:] + 359968
3  karmaMobile                    0x100973fdc __50-[RCTUIManager createView:viewName:rootTag:props:]_block_invoke + 336212
4  libdispatch.dylib              0x18da01200 _dispatch_call_block_and_release + 24
5  libdispatch.dylib              0x18da011c0 _dispatch_client_callout + 16
6  libdispatch.dylib              0x18da05d6c _dispatch_main_queue_callback_4CF + 1000
7  CoreFoundation                 0x18eb25f2c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
8  CoreFoundation                 0x18eb23b18 __CFRunLoopRun + 1660
9  CoreFoundation                 0x18ea52048 CFRunLoopRunSpecific + 444
10 GraphicsServices               0x1904d5198 GSEventRunModal + 180
11 UIKit                          0x194a2c628 -[UIApplication _run] + 684
12 UIKit                          0x194a27360 UIApplicationMain + 208
13 karmaMobile                    0x1000ad3b4 main + 14 (main.m:14)
14 libdyld.dylib                  0x18da345b8 start + 4

Join a screenshot or video of the problem on the simulator or device?
I can't reproduce on my device or on the simulator.

Show us the code you are using?

      <Pdf
          ref={(pdf) => {
            this.pdf = pdf;
          }}
          source={{
            uri: this.props.uri,
            cache: this.props.cache,
          }}
          page={1}
          horizontal={false}
          onLoadComplete={(pageCount, path) => {
            this.setState(() => ({
              pageCount,
              path,
            }));
          }}
          onPageChanged={(page) => {
            this.setState(() => ({ page }));
          }}
          onError={(error) => {
            let message = error.message || `Error reading pdf at ${this.props.uri}`;
            let buttons = null;

            if (message.length > 200) {
              message = message.substr(0, 200);
            }

            if (/401/.test(message)) {
              message = I18n.t('error.session');
              buttons = [
                {
                  text: I18n.t('consultation.reconnection'),
                  onPress: () => NavigationService.navigate('SigninSimple'),
                },
              ];
            }

            Alert.alert(I18n.t('error.error'), message, buttons);
          }}
          style={styles.pdf}
        />
@abrel abrel changed the title [iOS 12] - Crash when loading a pdf - potentially linked to jailbreaked devices [iOS 12][react-native-pdf 5.1.5] - Crash when loading a pdf - potentially linked to jailbreaked devices Oct 5, 2019
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

1 participant