简体   繁体   English

Ionic Cordova应用未在Android上安装

[英]Ionic Cordova App Not Installing on Android

I'm fairly certain the issue persists on all Android devices. 我相当确定这个问题在所有Android设备上仍然存在。 However I can be wrong. 但是我可能是错的。

I get through the build process with no errors. 我顺利完成了构建过程。 I find the APK file in the proper folder but when I upload it via USB (not through CLI adb) to my Android (Galaxy S7 edge) it says "App not Installed" after having it go through trying to Install. 我在适当的文件夹中找到了APK文件,但是当我通过USB(不是通过CLI adb)将其上传到我的Android设备(Galaxy S7 edge)时,在尝试安装后显示“未安装应用程序”。 I am not sure this has anything to do with the processor on my phone as I ran into a similar issue when installing apps made with RPG Maker MV. 我不确定这与手机上的处理器有关,因为在安装使用RPG Maker MV制作的应用程序时遇到了类似的问题。 Right now I'm just (re)trying my hand on Android dev using ionic / Cordova rather than standard Java based Android development. 现在,我只是在使用ionic / Cordova(而不是基于Java的标准Java开发)来尝试Android开发。

Note: I already have debug mode / unknown sources checked. 注意:我已经检查了调试模式/未知来源。 The app itself works fine in web browser testing. 该应用程序本身可以在网络浏览器测试中正常运行。

So main question: How do I get it to install? 因此,主要问题是:如何安装它?

Side question: Is there a way to tell ionic what version of Android I want to build for? 附带问题:有没有办法告诉Ionic我要构建哪个版本的Android? (I have a few of the SDKs installed) (我安装了一些SDK)

OP's Feedback OP的反馈

cordova run android --device

Original Answer 原始答案

  1. You need to create a debug version of apk using below CLI command. 您需要使用以下CLI命令创建apk的调试版本。

     ionic run android --device 
  2. Plug a device to the PC using USB 使用USB将设备插入PC

  3. Copy the android-debug.apk file to the device(apk path:.. \\platforms\\android\\build\\outputs\\apk ) android-debug.apk文件复制到设备(apk路径:.. \\platforms\\android\\build\\outputs\\apk

  4. After that, You have to enable below setting on your Android device. 之后,您必须在Android设备上启用以下设置。

settings --> general tab --> security --> unknown sources (enabled this) 设置->常规标签->安全->未知来源(启用此功能)

  1. After that just double-clicked the android-debug.apk from the location which you have copied.Then your app will be installed on your device. 之后,只需从android-debug.apk的位置双击android-debug.apk ,然后您的应用程序将安装在您的设备上。

i'm not sure if that command still works, but this worked for me 我不确定该命令是否仍然有效,但这对我有用

ionic cordova build --debug android 离子科尔多瓦建立-调试android

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM