小编Tal*_*ani的帖子

错误:global.nativeTraceBeginSection不是函数

我没有进行任何更改,但是突然我的xproject中出现了此错误,并且应用程序卡住了,当我通过Xcode进行模拟器时,事情发生了,但物理设备无法正常工作。完整的日志在这里:

        'Failed to print error: ', 'global.nativeTraceBeginSection is not a function. (In \'global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileName, args)\', \'global.nativeTraceBeginSection\' is undefined)'
       WARNING: Logging before InitGoogleLogging() is written to STDERR
   E0910 19:37:09.077337 1871998976 JSCHelpers.cpp:137] Got JS Exception: Exception calling object as function: global.nativeTraceEndSection is not a function. (In 'global.nativeTraceEndSection(TRACE_TAG_REACT_APPS)', 'global.nativeTraceEndSection' is undefined) (<unknown file>:2303)
  E0910 19:37:09.077525 1871998976 JSCHelpers.cpp:143] Got JS Stack: endEvent@http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:2303:35
  __callFunction@http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:2098:24
  http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:1927:29
__guard@http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:2068:11
 callFunctionReturnFlushedQueue@http://192.168.1.27.xip.io:8081/index.bundle?platform=ios&dev=true&minify=false:1926:19
 callFunctionReturnFlushedQueue@[native code]
2018-09-10 19:37:09.079 [fatal][tid:com.facebook.react.JavaScript] Error calling Systrace.setEnabled

 Unhandled JS Exception: Exception calling object as function: global.nativeTraceEndSection is …
Run Code Online (Sandbox Code Playgroud)

xcode ios react-native

3
推荐指数
2
解决办法
1740
查看次数

支持的方向与应用程序没有共同的方向,并且 [RCTModalHostViewController shouldAutorotate] 返回 YES

我在 iOS 上有本机反应的应用程序,我通过执行以下操作将其锁定在横向模式:

componentDidMount() {
Orientation.lockToLandscape()
}
Run Code Online (Sandbox Code Playgroud)

我添加了一个弹出窗口,但是当我按下它时,我收到了这个错误:

 Exception thrown while executing UI block:
 Supported orientations has no common orientation with the application,
 and [RCTModalHostViewController shouldAutorotate] is returning YES
Run Code Online (Sandbox Code Playgroud)

在 app.delegate 上我添加了这个功能:

 - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
while ([[UIDevice currentDevice] isGeneratingDeviceOrientationNotifications]) {
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
 }

 return [Orientation getOrientation];
   }
Run Code Online (Sandbox Code Playgroud)

在肖像上这个错误没有发生

怎么解决。。。谢谢

landscape popover ios react-native

3
推荐指数
1
解决办法
870
查看次数

标签 统计

ios ×2

react-native ×2

landscape ×1

popover ×1

xcode ×1