cordova run android 执行得很好.但是Android 4.1.2 不启动应用程序 [英] cordova run android executes fine. But Android 4.1.2 doesn't start the app

查看:20
本文介绍了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 

并手动将platforms/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 

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

推荐答案

我遇到了同样的问题 (Cordovahello 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 命令可以在文件平台androidcordovalibdevice.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 ' +resolutionTarget.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 不启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆