Home / GitHub Page

Node loops when running `npm run start-android`

When running npm run start-android The pop-out node terminal just repeats over and over and I get a white screen on the android app.

I’m in windows. I just installed the latest LTS nodejs (12.17).

It seems to get stuck on various stages of Converting database to version X

 BUNDLE  [android, dev] ./index.android.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1/1), done.

 BUNDLE  [android, dev] ./index.android.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1/1), done.

 LOG  Running "Joplin" with {"rootTag":131}
 WARN  Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: Connect(AppComponent), Provider
 WARN  Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: Connect(AppComponent)
 INFO  02:43:31 ====================================
 INFO  02:43:31 Starting application net.cozic.joplin-mobile (dev)
 INFO  02:43:31 Database was open successfully
 INFO  02:43:31 Checking for database schema update...
 INFO  02:43:31 Current database version 8
 INFO  02:43:31 Converting database to version 9
 BUNDLE  [android, dev] ./index.android.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1/1), done.

 BUNDLE  [android, dev] ./index.android.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1/1), done.

 LOG  Running "Joplin" with {"rootTag":141}
 WARN  Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: Connect(AppComponent), Provider
 WARN  Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: Connect(AppComponent)
 INFO  02:43:35 ====================================
 INFO  02:43:35 Starting application net.cozic.joplin-mobile (dev)
 INFO  02:43:35 Database was open successfully
 INFO  02:43:35 Checking for database schema update...
 INFO  02:43:36 Current database version 8
 INFO  02:43:36 Converting database to version 9

Occasionally this error pops up on the Android emulator:

Here’s the output from npm run start-android

PS C:\code\joplin\ReactNativeClient> npm run start-android                                                              
> Joplin@0.8.0 start-android C:\code\joplin\ReactNativeClient
> react-native run-android

warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - react-native-push-notification: https://github.com/zo0r/react-native-push-notification#readme
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
  - react-native-camera (to unlink run: "react-native unlink react-native-camera")
  - react-native-document-picker (to unlink run: "react-native unlink react-native-document-picker")
  - react-native-file-viewer (to unlink run: "react-native unlink react-native-file-viewer")
  - react-native-fs (to unlink run: "react-native unlink react-native-fs")
  - react-native-image-picker (to unlink run: "react-native unlink react-native-image-picker")
  - react-native-image-resizer (to unlink run: "react-native unlink react-native-image-resizer")
  - react-native-push-notification (to unlink run: "react-native unlink react-native-push-notification")
  - react-native-quick-actions (to unlink run: "react-native unlink react-native-quick-actions")
  - react-native-securerandom (to unlink run: "react-native unlink react-native-securerandom")
  - react-native-sqlite-storage (to unlink run: "react-native unlink react-native-sqlite-storage")
  - react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
  - react-native-version-info (to unlink run: "react-native unlink react-native-version-info")
  - rn-fetch-blob (to unlink run: "react-native unlink rn-fetch-blob")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1353 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-fs
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-image-picker
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-image-resizer
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-push-notification
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-securerandom
WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

> Configure project :react-native-webview
:react-native-webview:reactNativeAndroidRoot C:\code\joplin\ReactNativeClient\node_modules\react-native\android

> Task :app:installDebug
02:48:43 V/ddms: execute: running am get-config
02:48:43 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1
02:48:43 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Pixel_3a_API_29(AVD) - 10' for app:debug
02:48:43 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
02:48:43 D/Device: Uploading file onto device 'emulator-5554'
02:48:43 D/ddms: Reading file permision of C:\code\joplin\ReactNativeClient\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------
02:48:43 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
02:48:44 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
02:48:44 V/ddms: execute: returning
02:48:44 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
02:48:45 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
02:48:45 V/ddms: execute: returning
Installed on 1 device.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 14s
334 actionable tasks: 2 executed, 332 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=net.cozic.joplin/.MainActivity }

I’ve done android development before but never react native so I’m struggling getting this thing passed this loop with no error.

Appreciate the help.

This is due to React Native Live Reload feature, which they enable by default even though it’s broken. I had tried to disable it in code but it doesn’t look like it’s working, so you’ll need to open the debug menu Ctrl+M and disable Live Reload. Then close the app completely and reload.

1 Like

I wanted to follow up and say the only way I can get out of these loops is by background the app while the database stuff sets up, then foregrounding the app once that is all done. It’s quite weird.