将 Nativescript 从 6.5.1 更新到 8.2 后,IOS 应用程序在模拟器中崩溃

发布于 2025-01-13 16:52:04 字数 2863 浏览 0 评论 0原文

我在本地将本机脚本应用程序从 6.5.1 迁移到 8.2,当我执行“tns run ios”时,我的项目构建得很好,它会在模拟器上安装该应用程序,但在打开时会崩溃并关闭。我无法弄清楚问题出在哪里,并且被困在这里并且无法继续前进,请让我知道如何解决此问题或我缺少什么?

包.json

{
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/forms": "~13.2.0",
    "@angular/http": "8.0.0-beta.10",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/router": "~13.2.0",
    "base-64": "^0.1.0",
    "cross-env": "^5.2.0",
    "lodash": "^4.17.11",
    "nativescript-appversion": "1.4.4",
    "@nativescript/camera": "5.0.10",
    "nativescript-couchbase": "1.0.18",
    "@nativescript/email": "2.0.5",
    "@nativescript/geolocation": "8.0.2",
    "nativescript-orientation": "2.2.5",
    "nativescript-phone": "3.0.3",
    "nativescript-screen-orientation": "2.0.0",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.13",
    "rxjs": "~7.5.0",
    "rxjs-compat": "^6.4.0",
    "utf8": "^3.0.0",
    "zone.js": "~0.11.5",
    "@nativescript/core": "~8.2.0",
    "@nativescript/angular": "^13.0.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.2.0",
    "@angular/compiler-cli": "~13.2.0",
    "@nativescript/ios": "8.2.1",
    "@nativescript/schematics": "~0.5.0",
    "@nativescript/types": "~8.2.0",
    "@nativescript/webpack": "5.0.6",
    "@ngtools/webpack": "~13.2.0",
    "typescript": "~4.5.5"
  },
  "readme": "NativeScript Application",
  "main": "./src/main.ts"
}

tsconfig.json

{
    "compilerOptions": {
        "module": "esnext",
        "target": "es2017",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noEmitHelpers": true,
        "noEmitOnError": true,
       "skipLibCheck": true,
       "skipDefaultLibCheck": true,
        "lib": [
            "dom",
            "es2017"
        ],
        "baseUrl": ".",
        "paths": {
            "~/*": ["src/*"],
            "@/*": ["src/*"]
          },
        "moduleResolution": "node",
        "removeComments": false
    },
    "include": [ "src/**/*.ios.ts"],
    "files": ["./src/main.ts", "./reference.d.ts"],
    "exclude": [
        "node_modules",
        "platforms"
    ]
}

webpackconfig.js

const webpack = require("@nativescript/webpack");

module.exports = (env) => {
    webpack.init(env);
    return webpack.resolveConfig();
};

I migrated my nativescript application from 6.5.1 to 8.2 locally, my project is building fine when I do "tns run ios" ,it installs the app on the simulator but it crashes and shuts down when its opened . I am unable to figure out where the issue is and am stuck here and unable to move forward, please let me know how to fix this or what i am missing?

package.json

{
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/forms": "~13.2.0",
    "@angular/http": "8.0.0-beta.10",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/router": "~13.2.0",
    "base-64": "^0.1.0",
    "cross-env": "^5.2.0",
    "lodash": "^4.17.11",
    "nativescript-appversion": "1.4.4",
    "@nativescript/camera": "5.0.10",
    "nativescript-couchbase": "1.0.18",
    "@nativescript/email": "2.0.5",
    "@nativescript/geolocation": "8.0.2",
    "nativescript-orientation": "2.2.5",
    "nativescript-phone": "3.0.3",
    "nativescript-screen-orientation": "2.0.0",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.13",
    "rxjs": "~7.5.0",
    "rxjs-compat": "^6.4.0",
    "utf8": "^3.0.0",
    "zone.js": "~0.11.5",
    "@nativescript/core": "~8.2.0",
    "@nativescript/angular": "^13.0.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.2.0",
    "@angular/compiler-cli": "~13.2.0",
    "@nativescript/ios": "8.2.1",
    "@nativescript/schematics": "~0.5.0",
    "@nativescript/types": "~8.2.0",
    "@nativescript/webpack": "5.0.6",
    "@ngtools/webpack": "~13.2.0",
    "typescript": "~4.5.5"
  },
  "readme": "NativeScript Application",
  "main": "./src/main.ts"
}

tsconfig.json

{
    "compilerOptions": {
        "module": "esnext",
        "target": "es2017",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noEmitHelpers": true,
        "noEmitOnError": true,
       "skipLibCheck": true,
       "skipDefaultLibCheck": true,
        "lib": [
            "dom",
            "es2017"
        ],
        "baseUrl": ".",
        "paths": {
            "~/*": ["src/*"],
            "@/*": ["src/*"]
          },
        "moduleResolution": "node",
        "removeComments": false
    },
    "include": [ "src/**/*.ios.ts"],
    "files": ["./src/main.ts", "./reference.d.ts"],
    "exclude": [
        "node_modules",
        "platforms"
    ]
}

webpackconfig.js

const webpack = require("@nativescript/webpack");

module.exports = (env) => {
    webpack.init(env);
    return webpack.resolveConfig();
};

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南街九尾狐 2025-01-20 16:52:04

我在 main.ts 中漏掉了这个

runNativeScriptAngularApp({
});

当我添加它时,它起作用了!

runNativeScriptAngularApp({
    appModuleBootstrap: () => platformNativeScript().bootstrapModule(AppModule),
});

i was missing this one in the main.ts

runNativeScriptAngularApp({
});

When i added it worked!

runNativeScriptAngularApp({
    appModuleBootstrap: () => platformNativeScript().bootstrapModule(AppModule),
});

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文