この文書の現在のバージョンと選択したバージョンの差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| 
                    reactnative:エラー [2019/03/30 13:16] ips  | 
                
                    reactnative:エラー [2019/04/02 06:20] (現在) ips  | 
            ||
|---|---|---|---|
| ライン 11: | ライン 11: | ||
| </code> | </code> | ||
| - | ===== TypeError: Cannot read property 'setState' of undefined ===== | + | ===== TypeError: this state setState undefied ===== | 
| - | おそらくバインドの問題 | + | おそらくバインドの問題。bindをするか=>で書く。 | 
| + | ===== Accessing view manager configs directly off UIManager via UIManager ===== | ||
| + | |||
| + | <code> | ||
| + | blob:http://localhos…6-9c681da2d1b3:3574 Accessing view manager configs directly off UIManager via UIManager['AIRMapLite'] is no longer supported. Use UIManager.getViewManagerConfig('AIRMapLite') instead. | ||
| + | </code> | ||
| + | |||
| + | |||
| + | ===== 警告を非表示にする ===== | ||
| + | [[https://stackoverflow.com/questions/55117997/how-to-solved-uimanagerairmaplite-is-no-longer-supported-white-screen-with|How to solved UIManager['AIRMapLite'] is no longer supported. (White Screen with white Logo)]] | ||
| + | |||
| + | <code> | ||
| + | import {YellowBox} from 'react-native'; | ||
| + | |||
| + | render() { | ||
| + | YellowBox.ignoreWarnings(['Warning: ...']);  // <- insert the warning text here you wish to hide. | ||
| + | return ( | ||
| + | //cool ui stuff | ||
| + | ); | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | ===== Looking for JS files in ===== | ||
| + | |||
| + | いままで起動できていたのにできなくなった。 | ||
| + | |||
| + | {{:reactnative:pasted:20190401-070216.png}} | ||
| + | |||
| + | <code> | ||
| + | Looking for JS files in | ||
| + | C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts | ||
| + | |||
| + | Loading dependency graph, done. | ||
| + | Error: Unable to resolve module `./index` from `C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts/.`: The module `./index` could not be found from `C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts/.`. Indeed, none of these files exist: | ||
| + | * `C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)` | ||
| + | * `C:\Users\[User]\react\native_background_timer\node_modules\react-native\scripts\index\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)` | ||
| + | at ModuleResolver.resolveDependency (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:163:15) | ||
| + | at ResolutionRequest.resolveDependency (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:52:18) | ||
| + | at DependencyGraph.resolveDependency (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\node-haste\DependencyGraph.js:283:16) | ||
| + | at C:\Users\[User]\react\native_background_timer\node_modules\metro\src\lib\transformHelpers.js:261:42 | ||
| + | at Server.<anonymous> (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\Server.js:1038:41) | ||
| + | at Generator.next (<anonymous>) | ||
| + | at asyncGeneratorStep (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\Server.js:99:24) | ||
| + | at _next (C:\Users\[User]\react\native_background_timer\node_modules\metro\src\Server.js:119:9) | ||
| + | ::ffff:127.0.0.1 - - [31/Mar/2019:21:59:04 +0000] "GET /index.delta?platform=android&dev=true&minify=false HTTP/1.1" 500 - "-" "okhttp/3.12.1" | ||
| + | </code> | ||
| + | |||
| + | [[https://github.com/facebook/react-native/issues/23908|Error: Unable to resolve module `./index` from `\node_modules\react-native\scripts/.`: The module `./index` could not be found from `\node_modules\react-native\scripts/.`. Indeed, none of these files exist: #23908]] | ||
| + | |||
| + | とりあえず、 | ||
| + | <html>react-native start -- --reset-cache</html> | ||
| + | と | ||
| + | <html>react-native run-android</html> | ||
| + | を別コマンドラインで実行すると起動するが、今までどおりにはできない。 | ||
| + | |||
| + | ==== 対応その1 ==== | ||
| + | |||
| + | node_modules\react-native\scripts\launchPackager.bat | ||
| + | <code> | ||
| + | :: Copyright (c) Facebook, Inc. and its affiliates. | ||
| + | :: | ||
| + | :: This source code is licensed under the MIT license found in the | ||
| + | :: LICENSE file in the root directory of this source tree. | ||
| + | |||
| + | @echo off | ||
| + | title Metro Bundler | ||
| + | call .packager.bat | ||
| + | :: DELETE  | ||
| + | :: node "%~dp0..\cli.js" start //DELETE  | ||
| + | |||
| + | :: ADD | ||
| + | node "%~dp0..\cli.js" start --projectRoot ../../../  | ||
| + | pause | ||
| + | exit | ||
| + | </code> | ||
| + | |||
| + | ==== 対応その2 ==== | ||
| + | もしくは | ||
| + | \node_modules\@react-native-community\cli\build\commands\runAndroid\runAndroid.js を編集 | ||
| + | <code> | ||
| + | const procConfig = { | ||
| + | |||
| + | // delete this line  | ||
| + | cwd: scriptsDir | ||
| + | |||
| + | // add this line | ||
| + | cwd: process.cwd() | ||
| + | }; | ||
| + | </code> | ||
| + | |||
| + | 対応1で表示された! | ||