nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

getting error in main entry

Open sauravlhs opened this issue 4 years ago • 2 comments

Version: webpack 4.27.1 Time: 45160ms Built at: 27/08/2020 9:18:08 am Asset Size Chunks Chunk Names bundle.js 365 KiB bundle [emitted] bundle fonts/fa-brands-400.ttf 131 KiB [emitted] fonts/fa-regular-400.ttf 39.1 KiB [emitted] fonts/fa-solid-900.ttf 204 KiB [emitted] package.json 112 bytes [emitted] runtime.js 71.4 KiB runtime [emitted] runtime tns-java-classes.js 0 bytes [emitted] vendor.js 16.6 MiB vendor [emitted] vendor Entrypoint bundle = runtime.js vendor.js bundle.js [../$$_lazy_route_resource lazy recursive] ../$$_lazy_route_resource lazy namespace object 160 bytes {bundle} [built] [./app.scss] 121 KiB {bundle} [built] [./app/app.component.html] 329 bytes {bundle} [built] [./app/app.component.ts] 896 bytes {bundle} [built] [./app/app.module.ts] 1.36 KiB {bundle} [built] [./app/app.routing.ts] 653 bytes {bundle} [built] [./app/menu/menu.component.css] 19 bytes {bundle} [built] [./app/menu/menu.component.html] 1.05 KiB {bundle} [built] [./app/menu/menu.component.ts] 1.09 KiB {bundle} [built] [./app/services/dish.service.ts] 1.44 KiB {bundle} [built] [./app/services/process-httpmsg.service.ts] 784 bytes {bundle} [built] [./app/shared/baseurl.ts] 51 bytes {bundle} [built] [./main.ts] 1.84 KiB {bundle} [built] [./package.json] 100 bytes {bundle} [optional] [built] + 627 hidden modules Webpack compilation complete. Watching for file changes. Webpack build done! Project successfully prepared (android) Successfully transferred bundle.js on device d5cea600. Successfully transferred runtime.js on device d5cea600. Successfully transferred vendor.js on device d5cea600. Restarting application on device d5cea600... Successfully synced application org.nativescript.conFusion on device d5cea600. JS: HMR: Hot Module Replacement Enabled. Waiting for signal. JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode. System.err: An uncaught Exception occurred on "main" thread. System.err: Unable to start activity ComponentInfo{org.nativescript.conFusion/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed System.err: Error: Main entry is missing. App cannot be started. Verify app bootstrap. System.err: System.err: StackTrace: System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.conFusion/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed System.err: Error: Main entry is missing. App cannot be started. Verify app bootstrap. System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3499) System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3653) System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:151) System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:111) System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2224) System.err: at android.os.Handler.dispatchMessage(Handler.java:107) System.err: at android.os.Looper.loop(Looper.java:228) System.err: at android.app.ActivityThread.main(ActivityThread.java:7813) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:981) System.err: Caused by: com.tns.NativeScriptException: Calling js method onCreate failed System.err: Error: Main entry is missing. App cannot be started. Verify app bootstrap. System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1160) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1138) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1134) System.err: at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:19) System.err: at android.app.Activity.performCreate(Activity.java:7962) System.err: at android.app.Activity.performCreate(Activity.java:7951) System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3474) System.err: ... 11 more

sauravlhs avatar Aug 27 '20 04:08 sauravlhs

my package.json is

{ "nativescript": { "id": "org.nativescript.conFusion", "tns-android": { "version": "6.5.0" }, "tns-ios": { "version": "6.5.0" } }, "description": "NativeScript Application", "license": "SEE LICENSE IN ", "repository": "", "scripts": { "lint": "tslint "src/**/*.ts"" }, "dependencies": { "@angular/animations": "~8.2.0", "@angular/common": "~8.2.0", "@angular/compiler": "~8.2.0", "@angular/core": "~8.2.0", "@angular/forms": "~8.2.0", "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", "@nativescript/theme": "~2.3.0", "nativescript-angular": "~8.21.0", "nativescript-ui-sidedrawer": "~8.0.0", "reflect-metadata": "~0.1.12", "rxjs": "^6.4.0", "tns-core-modules": "~6.5.0", "zone.js": "~0.9.1" }, "devDependencies": { "@angular/compiler-cli": "~8.2.0", "@ngtools/webpack": "~8.2.0", "codelyzer": "~4.5.0", "nativescript-dev-webpack": "~1.5.0", "node-sass": "^4.7.1", "tslint": "~5.19.0", "typescript": "~3.5.3" }, "gitHead": "20a65d338ae8f8911087ab6615b89363f864b07b", "readme": "NativeScript Application" }

sauravlhs avatar Aug 27 '20 04:08 sauravlhs

Your package.json seems to miss the entry point "main": "main.js".

I recommend to start with a fresh template (template-hello-world-ng) with the latest NativeScript version 8.0.0

janoshrubos avatar Apr 13 '21 08:04 janoshrubos