cordova run android 执行良好.但Android 4.1.2 不启动应用

cordova run android executes fine. But Android 4.1.2 doesn#39;t start the app(cordova run android 执行良好.但Android 4.1.2 不启动应用)

本文介绍了cordova run android 执行良好.但Android 4.1.2 不启动应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用 Cordova 5.0.0 开发和 android 应用程序(cordova -v 打印 5.0.0),并在带有 Android 4.1.2 的 Moto Razr D1 上对其进行测试.在 Windows 7 下,顺便说一句.

I'm starting to develop and android app using Cordova 5.0.0 (cordova -v prints 5.0.0), and testing it on a Moto Razr D1 with Android 4.1.2. Under Windows 7, btw.

cordova build 

并手动将平台/android/build/output/apk/android-degug.apk 复制到 SD 并安装工作正常.

and manually copying the platforms/android/build/output/apk/android-degug.apk to the SD and installing works fine.

cordova emulate android 

在安卓版本>4.1.2的模拟器上运行良好

runs fine on emulator with android version >4.1.2

cordova run android 

构建成功,说使用 apk 平台/android/build/output/apk/android-debugger.apk,看起来还可以,安装应用程序,启动和启动成功.但是,正如您在此屏幕截图中看到的那样

builds successfully, says using apk platforms/android/build/output/apk/android-debugger.apk, which seems ok, installing app, launching and LAUNCH SUCCESS. however as you can see in this screenshot

Razr 截图

这个壁纸/管理/设置"的事情发生了,就是这样.

This "WALLPAPER/MANAGE/SETTINGS" thing happens, and that's it.

如果我执行:

cordova emulate android

在装有 Android 4.1.2 Jelly 的模拟器上,输出相等

On an emulator with Android 4.1.2 Jelly, an equal output

BUILD SUCCESSFUL

Total time: 6.352 secs
Built the following apk(s):
    C:androidSomeplatformsandroiduildoutputsapkandroid-debug.apk
Installing app on emulator...
Using apk: C:androidSomeplatformsandroiduildoutputsapkandroid-debug.apk
Launching application...
LAUNCH SUCCESS

相同的WALLPAPAER/MANAGE/SETTINGS",这是另一个屏幕截图模拟器屏幕截图

same "WALLPAPAER/MANAGE/SETTINGS", here's another screenshot Emulator Screenshot

任何想法如何解决这个问题?提前谢谢...

Any ideas how to solve this issue? Thanks in advance...

PS:如果我之前安装了 apk,Razr 将启动旧版本,而不是 WALLPAPER/MANAGE/SETTINGS 的东西.所以我必须先卸载它,然后再尝试运行 cordova 运行命令.

PS: If I've installed the apk previously, the Razr will startup the old version, instead of the WALLPAPER/MANAGE/SETTINGS thing. So I have to uninstall it before trying to run the cordova run commands.

推荐答案

我遇到了同样的问题(Cordova "hello world" 应用程序不会显示)并找到了通过它的方法(但我不太了解根本原因).

I met the same problem (Cordova "hello world" app won't display) and found a way to pass through it (but I don't really understand the underlying causes).

安装 apk 时似乎出现问题.在 Cordova 5.0.0 上,安装 apk 的 adb 命令可以在文件 platformsandroidcordovalibdevice.js 的第 101 行找到(对于 cordova,在 platformsandroidcordovalibemulator.js 的第 311 行)模拟安卓):

Problem seemed to occur when installing the apk. On Cordova 5.0.0, adb commands to install the apk can be found at line 101 of file platformsandroidcordovalibdevice.js (and at line 311 of platformsandroidcordovalibemulator.js for cordova emulate android):

adb -s ' + resolvedTarget.target + ' install -r -d "' + apk_path + '"

当前命令返回给我:错误:未知选项 -d"!

Current command returns to me: "Error: unknown option -d"!

如果简单地删除-d"选项,应用程序在cordova run android下正常运行.

-d 应该直接出现在 adb 之后(如 --device 中),而不是在安装之后.所以你可以把它移到那里而不是移除它.

The -d is supposed to come directly after adb (as in --device) instead of after install. So you can just move it there instead of removing it.

另外,这是 apache cordova 问题跟踪器上打开的问题

这篇关于cordova run android 执行良好.但Android 4.1.2 不启动应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:cordova run android 执行良好.但Android 4.1.2 不启动应用

基础教程推荐