【问题标题】:Nativescript tns run android (application is not running on device)Nativescript tns 运行 android(应用程序未在设备上运行)
【发布时间】:2020-11-27 02:38:33
【问题描述】:

当我执行 tns 运行 ios 时,一切都很好,但 tns 运行 android 只会给我这样的错误。我尝试了设备和模拟器,但结果相同。


我已经完成了:

  • 重新安装平台、节点模块、挂钩。 tns 医生没有出错
  • 清除webstorm上的缓存(android studio项目没有问题
  • 正在运行)使用 tns create 创建了新的 {N} 文件,但发生了同样的错误
  • 将 'applicationId = "org.nativescript.fagck_app"' 放在我的
  • app.gradle 文件。多次重启PC/adb。运行 `tns 调试
  • android --debug-brk` 但仍然出现同样的错误
  • 重新安装 brew jdk8

错误代码:

Installing on device 2744b499...
Successfully installed on device with identifier '2744b499'.
Application org.nativescript.fagck_app is not running on device 2744b499.
This issue may be caused by:
        * crash at startup (try `tns debug android --debug-brk` to check why it crashes)
        * different application identifier in your package.json and in your gradle files (check your identifier in `package.json` and in all *.gradle files in your App_Resources directory)
        * device is locked
        * manual closing of the application
Unable to apply changes on device: 2744b499. Error is: Application org.nativescript.fagck_app is not running.

【问题讨论】:

    标签: android build nativescript


    【解决方案1】:

    在我的情况下,由于设备内存溢出,这不起作用。清理内存并尝试重新安装

    【讨论】:

      【解决方案2】:

      对我来说问题是应用程序 id 在两者中都不同:

      package.json

      }
        ...
          "nativescript": {
          "id": "org.nativescript.myApp"
        }
      }
      

      还有nativescript.config.ts

      export default {
        id: 'org.nativescript.myApp',
        appResourcesPath: 'App_Resources',
        android: {
          v8Flags: '--expose_gc',
          markingMode: 'none'
        }
      } as NativeScriptConfig;
      

      必须相同。 之后,它就可以正常工作了。

      【讨论】:

        【解决方案3】:

        在数据线连接到手机时尝试以下命令:

        1. adb kill-server
        2. sudo adb start-server
        3. sudo adb 重新连接

        然后重试运行 NativeScript 命令。

        【讨论】:

          【解决方案4】:

          在可能的情况下,我在我的 mac 中安装了一个也运行 adb 的软件。主要问题确实是它与 android adb 冲突。卸载那个软件解决了问题

          【讨论】:

            【解决方案5】:

            尝试将应用程序 ID 更改为“com.example.myapp”,其中 example 是您的域名。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 2023-03-14
              • 1970-01-01
              • 1970-01-01
              • 2017-08-18
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多