There are a few known issues that you might run into as you develop mobile applications with NativeScript. The following is a list of such problems, as well as workarounds you can use to overcome them.
Problem: After switching branches your app no longer builds, or does not display new changes.
Solution: The NativeScript CLI generates platform-specific native projects for your app in the
platforms/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 and install any new npm dependencies using the
tns install command.
... Unable to start service com.apple.mobile.installation_proxy. Result code is: ...
Solution: Try one of the following approaches:
Sync with this iPhone over Wi-Fioption in iTunes on your machine should be disabled
- Disable your Wi-Fi and execute
tns device(when your device is connected and disconnected). It is possible that some other device is connected to the same Wi-Fi and this causes confusion in the way CLI communicates to the devices. You can find more info on the issue here.
Problem: Gradle doesn't work with
org.gradle.parallel=true enabled in
Solution: Currently there's no other solution than disabling parallel builds.
Problem: NativeScript CLI installation or
tns doctor complains that Xcode is not configured properly
Solution: Open a shell and run the following:
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Problem: Running your app on the iOS simulator produces an error like this:
Command xcrun with arguments simctl launch CC9DBE24-A540-40E4-A187-E7DE3ECDA254 org.nativescript.groceries failed with exit code 4. Error output: An error was encountered processing the command (domain=FBSOpenApplicationErrorDomain, code=4): The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 4.)
iOS Simulator -> Reset Contents and Settings
Problem: Running your app on Android produces an error like this:
The package manager service found that the device didn't have enough storage space to install the app.
Solution: Free up more space on your device/emulator.
- Black screen when running AVD emulator.
- AVD android emulator is laggy when running.
- tns doctor not finding any problems but tns run android --timeout 300 times out with error.
- Command gradlew.bat failed with exit code 1.
tns run androidthrows Java (javac) error.
Problem: Calling native functions having SIMD vector return type and/or arguments on
armv7 architectures crashes or returns garbage. See https://github.com/NativeScript/ios-runtime/issues/997 for any updates regarding the problem.
Solution: The 3rd party library that iOS Runtime uses to make native calls (libffi/libffi) does not support SIMD vectors for these 2 architectures. If your app needs to support 32-bit iOS devices and you want to consume such functions you must do so from the native part of a plugin in your app. Visit Building Plugins for more information on how to create one.
In order to create metadata for Swift classes the Metadata Generator needs to run between the compilation and linking phase (appname-Swift.h is created after the Swift files are compiled). As XCode doesn't provide a Build Phase for such purpose, the LD setting is pointing to the nsld.sh script which does the necessary work for creating the metadata and then calls the default Clang linker (if NS_LD is not set) with the arguments provided. Therefore, if you need to use an alternate linker yourself, define the NS_LD variable instead of LD.