如何解决将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不正确。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。