FB_SONARKIT_ENABLED = 1在iOS应用中初始化flipper时不起作用(iOS未选择应用程序)
我遵循以下步骤:
https://fbflipper.com/docs/docs/启动/react-native-ios/
(自动安装和手动安装)。
fb_sonarkit_enabled = 1
似乎不起作用。
flipper连接到设备,但在应用程序和中没有初始化的应用程序
错误显示错误。
标志看起来要设置好:
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'
target 'MYAPP' do
permissions_path = '../node_modules/react-native-permissions/ios'
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => true
)
pod 'SwiftLint'
target 'MYAPPTests' do
inherit! :complete
# Pods for testing
end
# Enables 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 |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
appdelegate:
#if DEBUG
// #if FB_SONARKIT_ENABLED. <-- this has to be commented for Flipper to start
// otherwise Flipper is never imported and initialised, same for
import FlipperKit
// #endif
#endif
@UIApplicationMain
class AppDelegate: UIResponder, RCTBridgeDelegate, UIApplicationDelegate,
UNUserNotificationCenterDelegate, RNAppAuthAuthorizationFlowManager {
private func initializeFlipper(with application: UIApplication) {
#if DEBUG
//#if FB_SONARKIT_ENABLED // If this is not commented Flipper never starts.
let client = FlipperClient.shared()
let layoutDescriptorMapper = SKDescriptorMapper(defaults: ())
// Notes: FlipperKitLayoutComponentKitSupport.setUpWith and
// client?.add(FlipperReactPerformancePlugin.sharedInstance()) need to be
// commented below for the build to work
// FlipperKitLayoutComponentKitSupport.setUpWith(layoutDescriptorMapper)
client?.add(FlipperKitLayoutPlugin(rootNode: application, with: layoutDescriptorMapper!))
client?.add(FKUserDefaultsPlugin(suiteName: nil))
client?.add(FlipperKitReactPlugin())
client?.add(FlipperKitNetworkPlugin(networkAdapter: SKIOSNetworkAdapter()))
// client?.add(FlipperReactPerformancePlugin.sharedInstance())
client?.start()
// #endif
#endif
}
相关问题:
https://github.com/facebook/flipper/flipper/issues/948
注意:我找不到任何内容添加标志fb_sonarkit_enabled
到swift_active_compilation_conditions
(在flipper doc中为调试构建的构建设置中)。
I followed all the steps from:
https://fbflipper.com/docs/getting-started/react-native-ios/
(both automatic and manual installation).
FB_SONARKIT_ENABLED=1
doesn't seem to work.
Flipper connects to device but it is not initialised in the app and NO APPLICATION SELECTED
error shows up.
Flag looks to be set OK:
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'
target 'MYAPP' do
permissions_path = '../node_modules/react-native-permissions/ios'
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => true
)
pod 'SwiftLint'
target 'MYAPPTests' do
inherit! :complete
# Pods for testing
end
# Enables 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 |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
AppDelegate:
#if DEBUG
// #if FB_SONARKIT_ENABLED. <-- this has to be commented for Flipper to start
// otherwise Flipper is never imported and initialised, same for
import FlipperKit
// #endif
#endif
@UIApplicationMain
class AppDelegate: UIResponder, RCTBridgeDelegate, UIApplicationDelegate,
UNUserNotificationCenterDelegate, RNAppAuthAuthorizationFlowManager {
private func initializeFlipper(with application: UIApplication) {
#if DEBUG
//#if FB_SONARKIT_ENABLED // If this is not commented Flipper never starts.
let client = FlipperClient.shared()
let layoutDescriptorMapper = SKDescriptorMapper(defaults: ())
// Notes: FlipperKitLayoutComponentKitSupport.setUpWith and
// client?.add(FlipperReactPerformancePlugin.sharedInstance()) need to be
// commented below for the build to work
// FlipperKitLayoutComponentKitSupport.setUpWith(layoutDescriptorMapper)
client?.add(FlipperKitLayoutPlugin(rootNode: application, with: layoutDescriptorMapper!))
client?.add(FKUserDefaultsPlugin(suiteName: nil))
client?.add(FlipperKitReactPlugin())
client?.add(FlipperKitNetworkPlugin(networkAdapter: SKIOSNetworkAdapter()))
// client?.add(FlipperReactPerformancePlugin.sharedInstance())
client?.start()
// #endif
#endif
}
Related questions:
https://github.com/facebook/flipper/issues/948
Note: I couldn't find anything about adding flag FB_SONARKIT_ENABLED
to SWIFT_ACTIVE_COMPILATION_CONDITIONS
(in Build settings for debug build) in Flipper docs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论