【问题标题】:Incompatible Android target device?不兼容的Android目标设备?
【发布时间】:2012-01-28 02:31:53
【问题描述】:

我是 Android 新手,只是想将示例项目(蓝牙聊天应用程序)加载到我的智能手机(运行 Android 2.3.4)上。 Eclipse 中的目标构建项目使用 Android API 级别 15 (Android 4.0.3)。当我在连接手机的情况下尝试“以 Android 应用程序运行”时,Android 设备选择器指示设备不兼容,并且我收到以下文本中显示的错误。我该如何解决这个问题?当然我不应该将我的构建目标降级到较低的 API 级别 (10) 和可能的松散功能吗?

顺便说一句,同一个项目在清单中包含这个:

<uses-sdk minSdkVersion="6" />

.

[2012-01-27 19:59:43 - BluetoothChat] Android Launch!
[2012-01-27 19:59:43 - BluetoothChat] adb is running normally.
[2012-01-27 19:59:43 - BluetoothChat] Performing com.example.android.BluetoothChat.BluetoothChat activity launch
[2012-01-27 19:59:43 - BluetoothChat] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2012-01-27 20:00:02 - BluetoothChat] WARNING: Application does not specify an API level requirement!
[2012-01-27 20:00:02 - BluetoothChat] Device API version is 10 (Android 2.3.4)
[2012-01-27 20:00:02 - BluetoothChat] Uploading BluetoothChat.apk onto device '304D1938E5584E7E'
[2012-01-27 20:00:02 - BluetoothChat] Installing BluetoothChat.apk...
[2012-01-27 20:00:03 - BluetoothChat] Re-installation failed due to different application signatures.
[2012-01-27 20:00:03 - BluetoothChat] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2012-01-27 20:00:03 - BluetoothChat] Please execute 'adb uninstall com.example.android.BluetoothChat' in a shell.
[2012-01-27 20:00:03 - BluetoothChat] Launch canceled!

非常感谢:)

【问题讨论】:

  • 您为什么希望 Android 2.3.4 设备具有 4.0.3 的功能?更重要的是,您为什么希望 SDK 允许您编写无法在目标设备上运行的代码?
  • 因为我认为 minSdkVersion="6" 可以让我在我的早期版本上运行它...?

标签: android sdk


【解决方案1】:
[2012-01-27 20:00:03 - BluetoothChat] Re-installation failed due to different application signatures.
[2012-01-27 20:00:03 - BluetoothChat] You must perform a full uninstall of the application. WARNING: This will remove the application data!

该应用已存在于您的设备上,并使用一个签名密钥进行了签名。您正在尝试在其上安装具有不同签名密钥的同一应用程序(即同一软件包)的另一个副本。

请从您的设备中删除现有的蓝牙聊天应用程序(例如,通过设置),然后运行该应用程序。

【讨论】:

  • 我在手机上找了高低找这个应用程序,但我找不到。但是,我的一位同事加载了一个他直接基于蓝牙聊天示例的应用程序......所以也许这就是冲突所在?
  • @GrahamPeyton:很可能就是这种情况。 Android 真正绊倒的是一个相同的包名称——AndroidManifest.xml 文件中 &lt;manifest&gt; 元素中的 package 属性。这在设备上必须是独一无二的(就此而言,在市场上)。如果您的同事克隆了 BluetoothChat 并且没有更改包名称,那么他的包将与您尝试加载的包相同。而且,由于他将使用他的签名密钥进行签名,因此您会在此处看到错误。
【解决方案2】:

您的项目的目标版本应为 10,这将允许项目在设备上运行 >= api 10。

【讨论】:

  • 我想我对最小 API 和目标 API 感到困惑。如果我将其更改为 10,则意味着我无法使用级别 > 10 的功能。我想添加一个需要 API 11 的操作栏,但现在我不能 -_-
  • 如果你想要 api11 的操作栏,这意味着应用程序将无法在具有
【解决方案3】:

正如它所说,用于在手机上签署 BluetoothChat 示例的密钥(可能是释放密钥?)与您用于运行它的密钥(调试密钥)不同。在您的手机上卸载该应用并(当它不在您的手机上时)选择“作为 Android 应用程序运行”。

如果密钥不同,您将无法升级应用程序(本质上是“作为 Android 应用程序运行”所做的)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-16
    • 2012-06-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多