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

CxxBridge NSInvalidArgumentException #19264

Closed
khiami opened this issue May 15, 2018 · 2 comments
Closed

CxxBridge NSInvalidArgumentException #19264

khiami opened this issue May 15, 2018 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@khiami
Copy link

khiami commented May 15, 2018

I am integrating Viromedia in react-native, react-native 0.49.3 was recommended for the integration to work (refer to @ VikAdvani comment).

I am getting the following exception in Xcode

// terminal 
...
2018-05-15 11:53:19.694807+0300 viroApp[3196:2202572] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[2]'
*** First throw call stack:
(0x183616d8c 0x1827d05ec 0x1835af750 0x1834e2a18 0x1834eec78 0x106011a08 0x10600ad08 0x107469260 0x107469220 0x10747aa84 0x10747a584 0x18323bfac 0x18323bb08)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Environment

OS: macOS High Sierra 10.13.4
Node: 8.11.1
Yarn: 1.5.1
npm: 6.0.0
Watchman: Not Found
Xcode: Xcode 9.3.1 Build version 9E501
Android Studio: 3.1 AI-173.4697961

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: ^0.49.3 => 0.49.5

The app is using the boilerplate used in the react-native init app + npm install react-viro as shown below

package.json

..
"dependencies": {
    "react": "16.3.1",
    "react-native": "^0.49.3",
    "react-viro": "^2.6.1"
  },
  "devDependencies": {
    "babel-jest": "22.4.3",
    "babel-preset-react-native": "4.0.0",
    "jest": "22.4.3",
    "react-test-renderer": "16.3.1"
  },
..

podfile inside ./ios/


platform :ios, '9.3'
target 'viroApp' do

  use_frameworks!
  pod 'ViroReact', :path => '../node_modules/react-viro/ios/'
  pod 'ViroKit', :path => '../node_modules/react-viro/ios/dist/ViroRenderer/'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'BatchedBridge',
    'RCTImage',
    'CxxBridge',
    'RCTActionSheet',
    'DevSupport',
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket',
  ]

  pod 'boost-for-react-native'

end

Xcode -> Build Settings
Bitcode = NO

Steps to Reproduce

It should run on a REAL DEVICE

$ react-native init viroApp
# cd project directory created ..
# cd to product root
# follow steps from @WikAdvanci https://github.com/viromedia/viro/issues/223
$ cd ios/
$ pod init
# update pod file with the above
$ pod install

// open Xcode and run

screen shot 2018-05-15 at 12 06 42 pm

Screenshot is taken from Xcode, from viroApp > libraries > React.xcodeproj > React > CxxBridge > RCTCxxBridge.mm

Expected Behavior

Build without errors

Actual Behavior

terminating with uncaught exception of type NSException

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?

Thank you for your contributions.

@khiami
Copy link
Author

khiami commented May 16, 2018

It worked and built successfully with the latest release. Now the Dev menu is not showing.

@khiami khiami closed this as completed May 16, 2018
@facebook facebook locked as resolved and limited conversation to collaborators May 16, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants