Recently, I followed the steps outlined in the Nativescript documentation for creating a new code sharing project here, and decided to incorporate sass into my project. I attempted both methods - one with the Nativescript theme applied, and the other without:
ng new -c=@nativescript/schematics no-theme-project --shared --no-theme
or
ng new -c=@nativescript/schematics sass-no-theme-project --shared --style=scss --no-theme
For this particular post, I opted for the No Theme option. Upon completing the creation of the new project, the folder structure looked like this:
https://i.sstatic.net/oQRYk.png
Once inside
Desktop/TestProjects/sass-no-theme-project
, I proceeded to install the necessary node modules:
npm install
Running ng serve --o
successfully built and launched the application in the browser as expected. However, when attempting to run the NativeScript mobile app on an Android device (I have not yet tested on iOS), the application crashed with an error. I tried using both tns run android
command line approach and through the NativeScript SideKick tool, but encountered the same issue. Local and cloud builds were also unsuccessful.
Device Information:
Physical Device: Samsung A5 (Not emulator)
Error Encountered on Mobile Device:
An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6065)
... (error continues)
Logs Output In Command Line and NativeScript Client:
[18-11-10 17:43:53.724] (CLI) [./main.ns.ts] 1.22 KiB {bundle} [built]
... (logs continue)
Given that Nativescript and Angular are supposed to seamlessly produce a working basic project across Web, iOS, and Android platforms, encountering these errors was unexpected.
UPDATE:
After following the troubleshooting steps provided here, such as re-installing JDK 8
, the issue persisted. The app ran once, then failed, and subsequent attempts resulted in failure as well. It appears there may be configuration issues within files such as tsconfig
and json
. Despite checking these configurations, the problem remains unresolved.