Nativescript tns运行android(应用程序不在设备上运行)

but5z9lq  于 2023-01-19  发布在  Android
关注(0)|答案(9)|浏览(143)

当我做tns运行ios,一切都很好,但tns运行android只是给我这样的错误。我尝试了设备和模拟器,但相同的结果。
我已完成:

  • 重新安装平台、node_module、hooks。tns doctor未执行任何错误
  • 清除webstorm上的缓存(android studio项目没有问题
  • 正在运行)使用tns create创建了新的{N}文件,但发生了相同的错误
  • 将“应用程序ID =“org.nativescript.fagck_app”“放到我的
  • app.gradle文件。多次重新启动PC/adb。运行调试
  • android --debug-brk '但仍发生相同错误
  • 重新安装brew jdk 8

错误代码:

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.
ccgok5k5

ccgok5k51#

我的问题是应用程序id在以下两个方面不同:

    • 包. json**
}
  ...
    "nativescript": {
    "id": "org.nativescript.myApp"
  }
}

本机脚本配置ts

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

一定是一样的,在那之后,它就好用了。

cgvd09ve

cgvd09ve2#

请在数据线连接到手机时尝试以下命令:
1.亚洲开发银行终止服务器

  1. sudo adb启动服务器
  2. sudo adb重新连接
    然后重试运行NativeScript命令。
hzbexzde

hzbexzde3#

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

fcwjkofz

fcwjkofz4#

在可能的情况下,我在Mac电脑上安装了一个也运行ADB的软件。主要的问题是它与Android ADB冲突。卸载该软件解决了这个问题

wnvonmuf

wnvonmuf5#

在我的情况下,这没有工作由于一个溢出的设备的内存.清理内存和尝试安装一次

uoifb46i

uoifb46i6#

我面临着同样的问题:

>>> ns run android
(...)
Project successfully built.
The build result is located at: /Users/krzysztof/dev/surfcloud-mobile-apps/bizApp/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Installing on device ce12171cd1a920bd0d...
Successfully installed on device with identifier 'ce12171cd1a920bd0d'.
Application app.surfcloud.bizApp is not running on device ce12171cd1a920bd0d.
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: ce12171cd1a920bd0d. Error is: Application app.surfcloud.bizApp is not running.

在我的情况下,解决办法是改变:

<activity android:exported="false" (...)/>

致:

<activity android:exported="true" (...)/>

AndroidManifest.xml中。将exported设置为true后,应用程序正常启动。

vmpqdwk3

vmpqdwk37#

对我来说,这只是因为我已经在设备上安装了这个应用程序的前一个版本。卸载就解决了这个问题。

y0u0uwnf

y0u0uwnf8#

在我的情况下,我用完了我的手机磁盘空间... tns显示它连接到我的手机,并开始安装,但随后崩溃与相同的msg如上。
所以我已经开始删除应用程序和图片,它只是工作。
因为这个错误出现在一个全新的项目上(W/O任何更改),也出现在一个已经完成的应用程序上,我知道它正在工作,因为它已经安装在我的手机上了...

m2xkgtsf

m2xkgtsf9#

  • 检查package.json和androidMenifest.xml中的应用程序ID是否相同
  • 如果看起来不错,然后打开android studio:工具〉AVD管理器〉擦除现有设备的数据。
  • 重新启动应用程序:tns运行android。

相关问题