React-native-navigation: [V2] Share API crashes the app

Created on 16 Apr 2019  路  4Comments  路  Source: wix/react-native-navigation

Issue Description

With the latest react native navigation (2.17.0), using the react-native Share API crashes the app with Thread 1: signal SIGABRT.

I couldn't get more detailed error message with this, but XCode is pointing at the file at path-to-react-native-navigation/lib/ios/UIViewController+LayoutProtocol.m. I'm not a native objective-c developer, so I'm not 100% sure what's actually causing this error. You should be able to reproduce this issue with the repo created below.

Seems like a regression from #4947.

Steps to Reproduce / Code Snippets / Screenshots

Reproduced a problem in the following boilerplate project

Run the following:

npm install
npm run start
npm run ios

Environment

  • React Native Navigation version: 2.17.0
  • React Native version: 0.59.4
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator/Not sure device?, Debug/Release
iOS

Most helpful comment

Fixed by this commit: https://github.com/wix/react-native-navigation/commit/275304c88e8f35bc053aec2328a94a38a6fce088
Available to test with the latest snapshot: 2.17.0-snapshot.283

All 4 comments

This happens for me as well.

I have the same problem. For catching bug is enough to execute the second step of install instruction of react-native-navigation: 'In Xcode, in Project Navigator (left pane), click on your project (top), then click on your target row (on the "project and targets list", which is on the left column of the right pane) and select the Build Phases tab (right pane). In the Link Binary With Libraries section add libReactNativeNavigation.a';

After that calling Share.share({
url: "data:application/pdf;base64,"+pdfBase64,
title: 'PDF'
});
crashes the app

This happens for me as well.

For me it will also crash with signal SIGABRT. Not sure whether it about race condition or not because it will only happen when I call share api very soon after showOverlay. The share api call button is in the overlay so that I suppose all component is ready.

It will not get any error if call share api after overlay showed 3 - 4 seconds.

Fixed by this commit: https://github.com/wix/react-native-navigation/commit/275304c88e8f35bc053aec2328a94a38a6fce088
Available to test with the latest snapshot: 2.17.0-snapshot.283

Was this page helpful?
0 / 5 - 0 ratings