React native 無法彈出調試控件的問題


React Native 在debug模式下,可以通過搖動手機,彈出調試選項。但是今天利用了cocoapods 把react native 文件整理后,調試界面就彈不出了,其他功能正常。查了好久,發現是少在pods的 spec里寫了DevSupport 這個模塊。

下面發一份pods 的 spec 文件作為參考:

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

target 'MapDemo' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for MapDemo


  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
  pod 'React', path: '../node_modules/react-native', :subspecs => [
    'Core',
    'RCTActionSheet',
    'RCTAnimation', 
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket’,
    ‘DevSupport’
  ]


  pod 'react-native-maps', path: '../node_modules/react-native-maps/react-native-maps.podspec'
  pod 'react-native-google-maps', path: '../node_modules/react-native-maps/react-native-google-maps.podspec' 


  pod 'GoogleMaps'



end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "react-native-google-maps"
      target.build_configurations.each do |config|
        config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
      end
    end
  end
end

再附上項目的文件結構

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM