NativeScript Troubleshooting and Getting Help
Notice: Undefined index: rate in /home/content/p3pnexwpnas11_data03/84/3795084/html/wp-content/themes/publisher/includes/functions.php on line 5532
The NativeScript framework has a vibrant community that’s here to help when you run into problems.
If you hit an issue, start by seeing if anyone else has reported the problem on the NativeScript community forum. If you can’t find any information, try creating a new forum topic with any details needed to recreate the issue.
If you’ve found an issue with the NativeScript framework itself, please report the problem in the appropriate GitHub repository.
Known Issues and Some Limitations
There are a few known issues that the developers might while developing mobile applications with NativeScript. Below are some of the common problems the developers might run into, as well as the workarounds they can use to continue developing.
My app broke after switching git branches
Problem: After switching branches, the app no longer builds, or does not display new changes.
Solution: The NativeScript CLI generates platform-specific native projects in the
platform/ios folders. When you switch branches you may need to regenerate those native projects for your app to function correctly.
Start by removing the existing platform(s) with the
tns platform remove command.
tns platform remove ios tns platform remove android
Next, add back the platforms—as well as install any new npm dependencies—using the
Files added to the App_Resources folder are not working
Problem: When you add images or files to your app’s App_Resources folder, run the app, and the images don’t show up when they should.
Solution: When you add files to the App_Resources folder you have to run a new build of the app. Files located in App_Resources are compiled into the executable so they can’t be synced with a previous build. Here are the correct steps to take to resolve the problem:
- Uninstall the old .apk (Android) or .ipa (iOS) from the device or emulator you are running the app on.
- Execute the
tns build androidor
tns build ioscommand to create a new .apk or .ipa for your app.
- Execute the
tns run androidor
tns run ioscommand to install the new executable, and you’ll find your files are now packaged into your application.
The debug command times out on Android devices
debug command times out when you attempt to debug on Android devices or emulators and the debug tools do not start.
debug command is configured with a 30-second timeout. On slower computer configurations, the CLI might exceed this timeout when connecting to your Android devices or emulators.
Solution: Re-run the
debug command. If you continue to have issue with your Android emulator performance, you may want to consider using a more performant third-party emulator option such as Genymotion.
The debug tools for Android never launch on macOS
Problem: The NativeScript CLI uses the opener npm package to open Chrome. The current version of the package that the CLI uses cannot open the browser.
Solution: Update the opener package to a newer version. If this does not resolve the issue, try modifying your local copy of the package.