Xcode 9 Runtime error: -[UIApplication applicationState] must be used from main thread
See original GitHub issueIs this a bug report?
Yes
Environment
Environment: OS: macOS Sierra 10.12.6 Node: 8.6.0 Yarn: 1.2.0 npm: 5.3.0 Watchman: 4.9.0 Xcode: Xcode 9.0 Build version 9A235 Android Studio: Not Found
Packages: (wanted => installed) react: 16.0.0-beta.5 => 16.0.0-beta.5 react-native: 0.49.3 => 0.49.3
Steps to Reproduce
- Open Xcode
- Run on device (iPhone 6s)
- Hit runtime error
Expected Behavior
No runtime error.
Actual Behavior
Runtime error:
Reproducible Demo
My package.json
:
{
"name": "[PROJECT]",
"version": "0.0.1",
"private": true,
"eslintConfig": {
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
}
},
"env": {
"browser": true,
"node": true
},
"plugins": [
"react",
"react-native"
],
"rules": {
"comma-dangle": [
2,
"always-multiline"
],
"semi": [
2,
"never"
],
"react-native/no-unused-styles": 2,
"react-native/split-platform-components": 2
}
},
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"babel-plugin-idx": "^2",
"he": "^1.1.0",
"jssha": "^2.3.1",
"lodash": "^4.17.2",
"moment-timezone": "^0.5.10",
"node-summary": "../node-summary",
"react": "16.0.0-beta.5",
"react-native": "0.49.3",
"react-native-blur": "^3.1",
"react-native-code-push": "5.1.3-beta",
"react-native-firebase": "^3.0",
"react-native-fit-image": "^1.4.8",
"react-native-highlight-words": "smartkarma/react-native-highlight-words",
"react-native-keep-awake": "envoy/react-native-keep-awake",
"react-native-linear-gradient": "^2.0.0",
"react-native-modalbox": "^1.3.8",
"react-native-notification": "../react-native-notification",
"react-native-orientation": "^3.0.0",
"react-native-parallax-scroll-view": "../react-native-parallax-scroll-view",
"react-native-safari-view": "^2.0.0",
"react-native-sentry": "^0.26",
"react-native-status-bar-size": "^0.3.2",
"react-native-swiper": "^1.5.10",
"react-native-tooltip": "../react-native-tooltip",
"react-native-tts": "^1.3.0",
"react-native-vector-icons": "^4.1.1",
"react-native-webview-bridge": "../react-native-webview-bridge-RN0.40",
"react-redux": "^5.0.1",
"redux": "^3.6.0",
"redux-thunk": "^2.1.0"
},
"devDependencies": {
"redux-logger": "^3.0.6"
},
"resolutions": {
"moment-timezone/moment": "^2.19.0"
}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:12 (5 by maintainers)
Top Results From Across the Web
UIApplication applicationState must be used from main thread ...
Main Thread Checker detects invalid usage of AppKit, UIKit and other APIs from background threads. completionHandler seems to update UI so ...
Read more >[UIApplication applicationState] s… | Apple Developer Forums
Hi,. I got this message from xcode "Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]". I know this message...
Read more >Main Thread Checker and XCUITests with Xcode 9 - Medium
Main Thread Checker is the handy tool to detect bugs in the code as soon as possible. It's activated by default in the...
Read more >Craft can not be used in an exported Xcode project - Codea
Simeon @John @jfperusse I export a craft project as Xcode project, ... UI API called on a background thread: -[UIApplication applicationState] PID: 4534, ......
Read more >【已解决】Xcode9提示:runtime UI API called from ... - 在路上
Xcode9 中,调试运行iOS的app,看到提示:. runtime: UI API called from background thread: -[UIApplication currentUserNotificationSettings] must ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It would be really nice to have that bugfix backported to a 0.49 patch release.
I can’t finish my upgrade to 0.49 because this breaks 0.49 in our iOS build. It would be preferable to not have to wait till the end of the month for 0.50 to finally get a release because of a 0.49 regression.
This was fixed in e8c83d1