我在我的设备(iPhone 6)上运行我的反应本机应用程序,它加载正常。但是,当我启用远程调试时,它似乎可以很好地连接到调试器,但卡在空白屏幕上。
一旦我关闭远程调试,一切都很好。
我在反应原生0.40.0。
请帮忙!
答案 0 :(得分:0)
我通过以下方式克服了这种影响:
答案 1 :(得分:0)
可能有很多原因,就我而言,正是缓存造成了问题。 建议的解决方案:-
gradlew clean
” react-native start --reset-cache
)这些步骤将解决问题!
答案 2 :(得分:0)
从iOS本机模块启动react本机模块时,我也面临同样的问题。
使用BUNDLE URL替换下面提到的代码
if let bundleUrl = (UIApplication.shared.delegate as? AppDelegate)?.bridge?.bundleURL {
let mockData:NSDictionary = ["names":
[
["name":"Name 1",],
["name":"Name 2"]
]
]
let rootView = RCTRootView(bundleURL: bundleUrl, moduleName: "modulename", initialProperties: mockData as [NSObject : AnyObject], launchOptions: nil)
let vc = UIViewController()
vc.view = rootView
self.present(vc, animated: true, completion: nil)
使用BRIDGE更新代码
if let bridge = (UIApplication.shared.delegate as? AppDelegate)?.bridge {
let mockData:NSDictionary = ["names":
[
["name":"Name 1",],
["name":"Name 2"]
]
]
let rootView = RCTRootView(bridge: bridge, moduleName: "modulename", initialProperties: mockData as [NSObject : AnyObject])
let vc = UIViewController()
vc.view = rootView
self.present(vc, animated: true, completion: nil)
}
解决问题!