swift – FB_SONARKIT_ENABLED=1 flag not working when initialising Flipper in iOS app (iOS NO APPLICATION SELECTED)


I adopted all the steps from:

https://fbflipper.com/docs/getting-started/react-native-ios/

(every automated and handbook arrange).

FB_SONARKIT_ENABLED=1 doesn’t seem to work.

Flipper connects to gadget nonetheless it’s not initialised inside the app and NO APPLICATION SELECTED error reveals up.

enter image description here

Flag seems to be wish to be set OK:

enter image description here

RN: 0.66.4
Flipper: 0.144.0

Podfile:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'


purpose 'MYAPP' do
  permissions_path="../node_modules/react-native-permissions/ios"
  config = use_native_modules!
  use_react_native!(
    :path => config[:reactNativePath],
    # to permit hermes on iOS, change `false` to `true` after which arrange pods
    :hermes_enabled => true
  )

  pod 'SwiftLint'
  
  purpose 'MYAPPTests' do
    inherit! :full
    # Pods for testing
  end

  
  # Permits Flipper.
 
  use_flipper!({ 'Flipper' => '0.144.0' }, configurations: ['debug'])
end

post_install do |installer|
  flipper_post_install(installer)

  react_native_post_install(installer)
  __apply_Xcode_12_5_M1_post_install_workaround(installer)
  
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end

  installer.pods_project.targets.each do |purpose|
    purpose.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
    end
  end
end

AppDelegate:

#if DEBUG
// #if FB_SONARKIT_ENABLED. <-- this must be commented for Flipper to start
// in some other case Flipper is never imported and initialised, similar for 
import FlipperKit
// #endif
#endif

@UIApplicationMain

  class AppDelegate: UIResponder, RCTBridgeDelegate, UIApplicationDelegate,
  UNUserNotificationCenterDelegate, RNAppAuthAuthorizationFlowManager {

  private func initializeFlipper(with utility: UIApplication) {
    #if DEBUG
    //#if FB_SONARKIT_ENABLED // If this is not commented Flipper certainly not begins.
    let shopper = FlipperClient.shared()
    let layoutDescriptorMapper = SKDescriptorMapper(defaults: ())

    // Notes: FlipperKitLayoutComponentKitSupport.setUpWith and 
    // shopper?.add(FlipperReactPerformancePlugin.sharedInstance()) should be 
    // commented beneath for the assemble to work
    // FlipperKitLayoutComponentKitSupport.setUpWith(layoutDescriptorMapper)
    shopper?.add(FlipperKitLayoutPlugin(rootNode: utility, with: layoutDescriptorMapper!))
    shopper?.add(FKUserDefaultsPlugin(suiteName: nil))
    shopper?.add(FlipperKitReactPlugin())
    shopper?.add(FlipperKitNetworkPlugin(networkAdapter: SKIOSNetworkAdapter()))
    // shopper?.add(FlipperReactPerformancePlugin.sharedInstance())
    shopper?.start()
    // #endif
    #endif
  }

Related questions:

https://github.com/fb/flipper/factors/948

Discover: I couldn’t uncover one thing about together with flag FB_SONARKIT_ENABLED to SWIFT_ACTIVE_COMPILATION_CONDITIONS (in Assemble settings for debug assemble) in Flipper docs.



Supply hyperlink

Leave a Reply

Your email address will not be published.