将NativeScript应用程序从3升级到7,有什么建议吗?

问题描述

我有一个大约在2015年左右开发的应用,急需升级。我尝试按照https://docs.nativescript.org/releases/upgrade-instructions上的升级说明进行操作,并且在使编译器无法正常工作之后,我现在遇到了一堆错误,就像Angular无法加载应用程序一样。

我正在与更广泛的社区联系,以查看是否有人在2015年做了类似的事情,或者是否有其他指导方针来升级使用Angular构建的旧NativeScript应用。

欢迎任何建议:-)

这是最新的日志输出


                File change detected. Starting incremental webpack compilation...
                Hash: 930f5656308d0b87060d
                Version: webpack 4.27.1
                Time: 7955ms
                Built at: 11/12/2020 11:12:59 AM
                                                  Asset       Size   Chunks             Chunk Names
                         app/images/home_background.png    256 KiB           [emitted]
                app/images/incident_map_placeholder.png    242 KiB           [emitted]
                       app/images/placeholder_image.png   7.62 KiB           [emitted]
                                              bundle.js    157 KiB   bundle  [emitted]  bundle
                                           package.json  112 bytes           [emitted]
                                             runtime.js   71.4 KiB  runtime  [emitted]  runtime
                                    tns-java-classes.js    0 bytes           [emitted]
                                              vendor.js   5.89 MiB   vendor  [emitted]  vendor
                Entrypoint bundle = runtime.js vendor.js bundle.js
                [./main.ts] 12.9 KiB {bundle} [built]
                    + 368 hidden modules

                WARNING in Lazy routes discovery is not enabled. Because there is neither an entryModule nor a statically analyzable bootstrap code in the main file.
                Webpack compilation complete. Watching for file changes.
                Webpack build done!

                ERROR in src/main.ts(226,3): error TS2304: Cannot find name 'firebase'.
                src/main.ts(287,20): error TS2304: Cannot find name 'iosUuidModule'.

                Updating runtime package.json with configuration values...
                Project successfully prepared (android)
                Building project...
                Gradle build...
                         + setting applicationId
                         + applying user-defined configuration from C:\pathtoproject\nativescript\xxx\App_Resources\Android\app.gradle
                         + using android X library androidx.legacy:legacy-support-v4:1.0.0
                         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
                         + adding aar plugin dependency: C:\pathtoproject\nativescript\xxx\node_modules\nativescript-loading-indicator\platforms\android\nativescript_loading_indicator.aar
                         + adding aar plugin dependency: C:\pathtoproject\nativescript\xxx\node_modules\@nativescript\core\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar
                Project successfully built.
                The build result is located at: C:\pathtoproject\nativescript\xxx\platforms\android\app\build\outputs\apk\debug\app-debug.apk
                Installing on device emulator-5554...
                Successfully installed on device with identifier 'emulator-5554'.
                Restarting application on device emulator-5554...
                Successfully synced application au.com.xxx.app on device emulator-5554.
                JS: HMR: Hot Module Replacement Enabled. Waiting for signal.
                System.err: An uncaught Exception occurred on "main" thread.
                System.err: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
                System.err: TypeError: application.start is not a function
                System.err: File: (file:///data/data/au.com.xxx.app/files/app/bundle.js:658:12)
                System.err:
                System.err: StackTrace:
                System.err: (file:///data/data/au.com.xxx.app/files/app/bundle.js:658:13)
                System.err:     at ./main.ts(file:///data/data/au.com.xxx.app/files/app/bundle.js:664:30)
                System.err:     at __webpack_require__(file: src\webpack\bootstrap:750:0)
                System.err:     at checkDeferredModules(file: src\webpack\bootstrap:43:0)
                System.err:     at webpackJsonpCallback(file: src\webpack\bootstrap:30:0)
                System.err:     at (file:///data/data/au.com.xxx.app/files/app/bundle.js:2:57)
                System.err:     at require(:1:266)
                System.err:
                System.err:
                System.err: TypeError: application.start is not a function
                System.err:
                System.err: StackTrace:
                System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
                System.err: TypeError: application.start is not a function
                System.err: File: (file:///data/data/au.com.xxx.app/files/app/bundle.js:658:12)
                System.err:
                System.err: StackTrace:
                System.err: (file:///data/data/au.com.xxx.app/files/app/bundle.js:658:13)
                System.err:     at ./main.ts(file:///data/data/au.com.xxx.app/files/app/bundle.js:664:30)
                System.err:     at __webpack_require__(file: src\webpack\bootstrap:750:0)
                System.err:     at checkDeferredModules(file: src\webpack\bootstrap:43:0)
                System.err:     at webpackJsonpCallback(file: src\webpack\bootstrap:30:0)
                System.err:     at (file:///data/data/au.com.xxx.app/files/app/bundle.js:2:57)
                System.err:     at require(:1:266)
                System.err:
                System.err:
                System.err: TypeError: application.start is not a function
                System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6465)
                System.err:     at android.app.ActivityThread.access$1300(ActivityThread.java:219)
                System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
                System.err:     at android.os.Handler.dispatchMessage(Handler.java:107)
                System.err:     at android.os.Looper.loop(Looper.java:214)
                System.err:     at android.app.ActivityThread.main(ActivityThread.java:7356)
                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:930)
                System.err: Caused by: com.tns.NativeScriptException: Error calling module function
                System.err: TypeError: application.start is not a function
                System.err: File: (file:///data/data/au.com.xxx.app/files/app/bundle.js:658:12)
                System.err:
                System.err: StackTrace:
                System.err: (file:///data/data/au.com.xxx.app/files/app/bundle.js:658:13)
                System.err:     at ./main.ts(file:///data/data/au.com.xxx.app/files/app/bundle.js:664:30)
                System.err:     at __webpack_require__(file: src\webpack\bootstrap:750:0)
                System.err:     at checkDeferredModules(file: src\webpack\bootstrap:43:0)
                System.err:     at webpackJsonpCallback(file: src\webpack\bootstrap:30:0)
                System.err:     at (file:///data/data/au.com.xxx.app/files/app/bundle.js:2:57)
                System.err:     at require(:1:266)
                System.err:
                System.err:
                System.err: TypeError: application.start is not a function
                System.err:     at com.tns.Runtime.runModule(Native Method)
                System.err:     at com.tns.Runtime.runModule(Runtime.java:674)
                System.err:     at com.tns.Runtime.run(Runtime.java:666)
                System.err:     at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
                System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1182)
                System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
                System.err:     ... 8 more

解决方法

前三个系统错误行指向(初始?)线索:

System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to create application com.tns.NativeScriptApplication:com.tns.NativeScriptException: Error calling module function
System.err: TypeError: application.start is not a function

我猜在您的入口点文件(main.ts?)中,导入对NS7不正确。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...