typescript Ionic 应用程序未安装在 Android 设备中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43131774/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 04:24:19  来源:igfitidea点击:

Ionic App not installing in android device

androidangulartypescriptionic-frameworkionic2

提问by Suraj Jeswara

I am a newbie in Ionic. I just made a simple app in Ionic that ran well on browser. So, I converted it into an .apk file using Android studios that generated an android-release-unsigned.apk file. I transfered it to my device and on trying to install it I encountered that it was not being installed. I am not able to figure out the cause. Need some assistance.

我是 Ionic 的新手。我刚刚在 Ionic 中做了一个简单的应用程序,在浏览器上运行良好。因此,我使用生成 android-release-unsigned.apk 文件的 Android 工作室将其转换为 .apk 文件。我将它传输到我的设备,并在尝试安装它时遇到它没有被安装。我无法弄清楚原因。需要一些帮助。

回答by Sampath

You can follow the steps which are mentioned in the official doc below.

您可以按照下面官方文档中提到的步骤进行操作。

Deploying to a Device

部署到设备

But for me, it didn't work.So I just manually did that as shown below.

但对我来说,它没有用。所以我只是手动做了,如下所示。

  1. ionic cordova run android --device

  2. Plugged device to the PC using USB

  3. Copy the android-debug.apkfile to the device (apk path:.. \platforms\android\build\outputs\apk)

  4. After that, You have to enable below setting on your Android device

  1. ionic cordova run android --device

  2. 使用 USB 将设备插入 PC

  3. android-debug.apk文件复制到设备(apk路径:..\platforms\android\build\outputs\apk)

  4. 之后,您必须在 Android 设备上启用以下设置

settings --> general tab --> security --> unknown sources (enabled this)

设置 --> 常规选项卡 --> 安全 --> 未知来源(启用此)

  1. After that just double-clicked the android-debug.apkfrom the location which you have copied.Then your app will be installed on your device.That is it.You can use your app on real device now.
  1. 之后只需双击android-debug.apk您复制的位置。然后您的应用程序将安装在您的设备上。就是这样。您现在可以在真实设备上使用您的应用程序。

回答by Korbin

The most probable reason I can think of is that your application is not signed. As Sampath mentioned try to build a debug version and not release version of your application and then install it on your device. You can can use 'ionic run android' and copy/paste manually the output android-debug.apk file to your device.

我能想到的最可能的原因是你的申请没有签名。正如 Sampath 提到的,尝试构建调试版本而不是发布应用程序的版本,然后将其安装在您的设备上。您可以使用“ionic run android”并将输出的 android-debug.apk 文件手动复制/粘贴到您的设备。

回答by Atiene Jonathan

  1. $ adb devices
  2. native-run android --app platform/your-app-debug-link.apk --device
  1. $ adb 设备
  2. 本机运行的 android --app 平台/your-app-debug-link.apk --device

回答by Koga

In the config.xml, in the 2nd line, there is a tag called widget. You have to give a unique id for that. If there is another ionic app installed with same widget id, your device will not allow you to install another app with the same id.

在 config.xml 的第 2 行中,有一个名为 widget 的标记。您必须为此提供一个唯一的 ID。如果安装了另一个具有相同小部件 ID 的 ionic 应用程序,您的设备将不允许您安装另一个具有相同 ID 的应用程序。

enter image description here

enter image description here