2012-01-27 58 views
2

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

顺便说一句,同样的项目包括在这个清单:

<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! 

非常感谢:)

+2

为什么你会期望Android 2.3.4设备具有4.0.3的功能?更重要的是,您为什么期望SDK能让您编写不会在目标设备上运行的代码? – arootbeer 2012-01-27 18:22:11

+0

因为我认为minSdkVersion =“6”可以让我在早期的版本上运行它...? – Graham 2012-01-27 19:45:08

回答

0

,因为它说,用于为您的手机上的BluetoothChat样品的关键(可能释放键?)是你正在使用运行它(的一个不同调试密钥)。卸载手机上的应用程序(当手机不在手机上时),选择“以Android应用程序运行”。

如果密钥不一致,则无法升级应用程序(实质上是“如何运行Android应用程序”)。

1

目标建立你的项目应该是10在这里,这将让该项目在设备上运行> = API 10

+0

我想我在最小的API和目标API之间感到困惑。如果我将其更改为10,那么这意味着我无法使用级别> 10以上的功能。我想添加一个需要API 11的操作栏,现在如果您需要api11的操作栏,则无法使用-_- – Graham 2012-01-27 19:43:37

+0

这意味着该应用程序不会运行在<11 api即高达2.3的手机上.. – 2012-01-28 15:28:21

2
[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! 

该应用程序已经存在你的设备,与一个签名密钥签署。您正尝试在另一个副本上安装另一个具有不同签名密钥的应用程序(即相同的程序包)。

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

+0

我在应用程序的手机上看到了高低,我无法找到它。然而,我的一个同事加载了一个应用程序,他直接基于蓝牙聊天的例子...所以也许这是冲突的地方? – Graham 2012-01-27 19:40:26

+0

@GrahamPeyton:情况很可能如此。 Android真正跳过的是一个相同的软件包名称 - AndroidManifest.xml文件的''元素中的'package'属性。在设备上(以及市场上),这必须是唯一的。如果您的同事克隆了BluetoothChat并且没有更改软件包名称,那么他将拥有与您要加载的软件包相同的软件包。而且,由于他会用他的签名密钥签名,所以你会看到你在这里看到的错误。 – CommonsWare 2012-01-27 19:48:20

+0

感谢您的帮助! – Graham 2012-01-27 19:55:59