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

Installing via CocoaPods makes debug menu unusable on iOS #2394

Closed
jcjoneskern opened this issue Jul 24, 2018 · 1 comment
Closed

Installing via CocoaPods makes debug menu unusable on iOS #2394

jcjoneskern opened this issue Jul 24, 2018 · 1 comment

Comments

@jcjoneskern
Copy link

Is this a bug report?

Yes (mostly)

Have you read the Installation Instructions?

Yes

Environment

react-native: 0.56.0
react: 16.4.1
react-native-maps: 0.21.0
iPhone 5s
Apple Maps for iOS, Google for Android (previously Google for both prior to RN 0.56.0 and RN Maps 0.21.0)

Steps to Reproduce

  1. Use react-native init to start a project
  2. Follow installation instructions for iOS
  3. Follow these instructions because there are Swift libraries our project requires
  4. Don't use Google Maps for iOS
  5. Build app

Expected Behavior

Dev menu should appear and app should function on both Android and iOS

Actual Behavior

App only works on Android, and iOS gets the errors described here: facebook/react-native#20354 (crossposting my own issue, sorry)
Then followed by #2369 when the app tries to load the map, though that last one may be unrelated.

Reproducible Demo

I could not for the life of me get a demo working, but using the podfile from #2324 in a working project should recreate the problem.

The main reason I say this is "mostly" a bug report was because I was able to get the app working again eventually. As best as I can tell, the source of the problem was that including the React pod in the podfile duplicated a whole bunch of imports which resulted in the debug menu being unusable. The code for that was copied from documentation found both in this library and in the official RN documentation, and I cannot for the life of me figure out why following the instructions bricked our project so badly.

My "solution" was stripping absolutely everything out of the podfile except for the other pod our app uses and using react-native link react-native-maps instead, but I know that's not how things are meant to be done. I then had to copy the AirMap folder into the project as described in #2369, but again, I'm sure that's unrelated because even when I got the debug menu to work, I still had the same AirMap problems.

I know that the reasons why use_frameworks! is unsupported with Google Maps is outside the control of this library, but I don't understand why using CocoaPods is required if you aren't using Google, and why use_frameworks! still isn't supported even if you aren't using Google.

Anyway I just wanted to share this on the off chance that if someone else is having this problem that they can find a solution (I couldn't find anything anywhere with the exact combination of problems we were having). But I also want to hopefully get some answers and see if there's a better way of doing things.

For reference, non-working podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'App' do
  use_frameworks!
  
  rn_path = '../node_modules/react-native'
  rn_maps_path = '../node_modules/react-native-maps'

  pod 'yoga', path: "#{rn_path}/ReactCommon/yoga"
  pod 'React', path: rn_path, subspecs: [
  'Core',
  'CxxBridge',
  'DevSupport',
  'RCTActionSheet',
  'RCTAnimation',
  'RCTGeolocation',
  'RCTImage',
  'RCTLinkingIOS',
  'RCTNetwork',
  'RCTSettings',
  'RCTText',
  'RCTVibration',
  'RCTWebSocket'
  ]
  
  pod 'react-native-maps', path: rn_maps_path
  
   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 'NokeMobileLibrary'

end

"Working" podfile:

platform :ios, '9.0'

target 'App' do
  use_frameworks!
  pod 'NokeMobileLibrary'
end
@roycedot
Copy link

I had this issue as well. I believe the issue is from React being included twice. Once from your main project, and once through the Pods workspace.

Try the fix here: software-mansion/react-native-svg#621

I'm able to bring the debug menu back up.

@rborn rborn closed this as completed Mar 4, 2020
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

3 participants