Java 安装错误:未知失败 Android App

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23430922/
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-08-13 22:58:11  来源:igfitidea点击:

Installation error: Unknown failure Android App

javaandroideclipse

提问by Pierre

I have just installed the Android ADT bundle with the Eclipse IDE.

我刚刚安装了带有 Eclipse IDE 的 Android ADT 包。

I have created a Android phone Simulator and I am trying to install and run my first application on it.

我已经创建了一个 Android 手机模拟器,我正在尝试在它上面安装和运行我的第一个应用程序。

Here's what I see in the Console log

这是我在控制台日志中看到的

Android Launch!
adb is running normally.
Performing com.example.outlast.MainActivity11 activity launch
Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
Uploading Outlast.apk onto device 'emulator-5554'
Installing Outlast.apk...
Installation error: Unknown failure
Please check logcat output for more details.
Launch canceled!

The application that I am trying to install is almost blank. I have just created a project with a blank activity and I am trying to run it. It is supposed to run according to to the official Android developers page.

我尝试安装的应用程序几乎是空白的。我刚刚创建了一个带有空白活动的项目,我正在尝试运行它。它应该根据官方 Android 开发人员页面运行。

I dont know how to look in the logcat output.

我不知道如何查看 logcat 输出。

How can I solve this problem ?

我怎么解决这个问题 ?

采纳答案by Pierre

I have finally resolved my problem.

我终于解决了我的问题。

I was unable to install any application on the android phone simulator because I had not waited long enough for the Android phone to load, so Eclipse couldn't install anything on the simulator.

我无法在 android 手机模拟器上安装任何应用程序,因为我没有等待足够长的时间来加载 Android 手机,因此 Eclipse 无法在模拟器上安装任何应用程序。

回答by DUSMANTA

You need to change device(emulator) android version to as per the target version. If still not working, then restart your emulator.

您需要根据目标版本将设备(模拟器)android 版本更改为。如果仍然无法正常工作,请重新启动模拟器。

回答by ignis

Guys i had the same issue and used the following way : (Windows 8 , Eclipse Luna)

伙计们,我遇到了同样的问题并使用以下方式:(Windows 8,Eclipse Luna)

1) Changing the ADB connection time out to 1000000ms 2) Use ADBhost 127.0.0.1 3) Changing Method Profiler Buffer Size to 20MB 4) Unchecking the Launcher from Snapshot at AVD Emulator Options.

1) 将 ADB 连接超时更改为 1000000 毫秒 2) 使用 ADBhost 127.0.0.1 3) 将方法探查器缓冲区大小更改为 20MB 4) 在 AVD 模拟器选项中从快照中取消选中启动器。

And of course several restarts xD

当然还有几次重启 xD

回答by Xarialon

The best way for me to solve the problem, was to open the terminal and use adb manager to restart the server. I use Mac OSX and this should also work on Windows and on Linux. Go to your sdk->platform-tools folder and use the command to type the following commands:

我解决问题的最好方法是打开终端并使用 adb manager 重新启动服务器。我使用 Mac OSX,这也适用于 Windows 和 Linux。转到您的 sdk->platform-tools 文件夹并使用该命令键入以下命令:

If you use Mac, then use ./adb instead of adb.

如果您使用 Mac,则使用 ./adb 而不是 adb。

adb kill-server (ENTER) adb start-server (ENTER)

adb kill-server (ENTER) adb start-server (ENTER)

extra: use adb devices to check if there are connected devices on your computer, so that you know for sure if adb works fine or not.

额外:使用 adb devices 检查您的计算机上是否有连接的设备,以便您确定 adb 是否正常工作。

After no problems detected, try to unplug your device and press on the play button for installing your app. When you see a window with no devices, then you have to plug your Android device on your computer again and select it to successfully install your app.

未检测到问题后,尝试拔下设备并按下播放按钮以安装您的应用程序。当您看到一个没有设备的窗口时,您必须再次将您的 Android 设备插入计算机并选择它才能成功安装您的应用程序。

回答by Vishwak

I am working on windows 8.1 OS and I resolved the same issue by using following steps:

我正在使用 Windows 8.1 操作系统,并通过使用以下步骤解决了相同的问题:

  1. Open the command prompt
  2. Navigate till /platform-toolsfolder (C:/Sample/sdk/platform-tools/)
  3. Type adb KILL-SERVERand hit enter
  4. Type again adb START-SERVERand hit enter
  5. Close the already opened eclipse and restart
  6. Try executing the android application and it will works
  1. 打开命令提示符
  2. 导航至/platform-tools文件夹 ( C:/Sample/sdk/platform-tools/)
  3. 类型adb KILL-SERVER和命中进入
  4. 再次adb START-SERVER输入并按回车键
  5. 关闭已经打开的eclipse并重启
  6. 尝试执行 android 应用程序,它会起作用

回答by S? Ph?m

In Play store, click left menu - my app and game - all tab - remove your application history - rebuild app

在 Play 商店中,单击左侧菜单 - 我的应用程序和游戏 - 所有选项卡 - 删除您的应用程序历史记录 - 重建应用程序

回答by Ashok Reddy

Same issue might also happen if you install the application some time back and now you are trying to install from another PC or sometime same PC.

如果您在一段时间后安装该应用程序,而现在您尝试从另一台 PC 或同一台 PC 进行安装,也可能会发生同样的问题。

Even though you have un-installed before installing new app, System maintain some data related to application. To overcome this completly unstall the application by using abd command.

即使您在安装新应用程序之前已卸载,系统也会维护一些与应用程序相关的数据。要克服这个问题,请使用 abd 命令完全解除应用程序的停顿。

adb uninstall my.package.id

Please refer another root cause for same issue. This helped me a lot after spending 5hrs of my time.

请参考同一问题的另一个根本原因。在花了 5 个小时的时间后,这对我帮助很大。

Eclipse simply says that "Installation error: Unknown failure"it does not give info on reason for fail in console window

Eclipse 只是说“安装错误:未知失败”,它没有在控制台窗口中提供有关失败原因的信息

To see what is the error message, install apk via adb command

要查看错误消息是什么,请通过 adb 命令安装 apk

> adb install app.apk

Then we can see the error message as "Failed to install app.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.myapp.id do not match the previously installed version; ignoring!]"

然后我们可以看到错误消息“无法安装app.apk:失败[INSTALL_FAILED_UPDATE_INCOMPATIBLE:包com.myapp.id与之前安装的版本不匹配;忽略!]”

This helps to understand the issue.

这有助于理解问题。