简体   繁体   English

由于我的htc欲望设备是api level 8(Android 2.2),我无法运行我的应用程序,我该怎么办?

[英]I can't run my application since my htc desire device is api level 8 (Android 2.2) what can i do?

In my application im using this: 在我的应用程序即时使用此:

private LayoutParams params;

And im getting error on it since it need api level 11. So in my manifest file I changed this line from 8 to 11: 我得到它的错误,因为它需要api级别11.所以在我的清单文件中,我将此行从8更改为11:

<uses-sdk android:minSdkVersion="11" />

Now im not getting errors in the eclipse. 现在我没有在日食中得到错误。 But once im trying to run the application I see this Android Device Chooser window and I see there on my device that the target is 2.2 with red X near it. 但是一旦我试图运行该应用程序,我会看到这个Android设备选择器窗口,我在设备上看到目标是2.2,其附近有红色X. If I click OK and try to run it im getting an error in the Console window in the Eclipse: 如果我单击确定并尝试运行它,我在Eclipse的控制台窗口中收到错误:

[2013-01-22 09:43:33 - AndroidVideoCapture] ERROR: Application requires API version 11. Device API version is 8 (Android 2.2).
[2013-01-22 09:43:33 - AndroidVideoCapture] Launch canceled!

How can I update my device to api 11 ? 如何将设备更新为api 11? I have a waiting software update on my device but each time I click INSTALL it's trying to restart but in fact it's shutting down the device and do nothing all I can do is to take out the batteries and turn on my device again but then again it will prompt for this software update. 我的设备上有一个等待的软件更新,但每次我点击安装它都试图重新启动但事实上它正在关闭设备并且什么都不做我所能做的就是取出电池并再次打开我的设备但是又一次将提示此软件更新。

What else can I do ? 我还可以做些什么 ? (Didn't find in google where to download api 11 if there is any). (没有在谷歌找到哪里下载api 11,如果有的话)。

Well , Have a glance of this to update the eclipse to 3.6 好吧,瞥一眼将这个日食更新到3.6

http://developer.android.com/tools/sdk/eclipse-adt.html http://developer.android.com/tools/sdk/eclipse-adt.html

or change the manifest file code as. 或者将清单文件代码更改为。

    android:minSdkVersion="8"
    android:targetSdkVersion="16" 

Use an unoffical build, I recommend to head over to XDA developers. 使用非官方的构建,我建议转向XDA开发人员。

Here's a link to your phone: http://forum.xda-developers.com/forumdisplay.php?f=628 这是您手机的链接: http//forum.xda-developers.com/forumdisplay.php?f = 628

XDA developers have alot of information how to flash your device to a newer android version. XDA开发人员有很多信息如何将您的设备刷新到更新的Android版本。

API level 11 is Honeycomb (3.0) or later. API级别11是Honeycomb(3.0)或更高版本。 As that is for tablets, you will need an ICS (Android 4.0) capable phone to test your code on a live device. 就像平板电脑一样,您需要一部支持ICS(Android 4.0)的手机才能在现场设备上测试您的代码。 As ICS is not available for the Desire officially, your best bet is to either buy a new phone or try to install cyanogenmod 9, which is an aftermarket firmware based on ICS. 由于ICS不能正式用于Desire,您最好的选择是购买新手机或尝试安装cyanogenmod 9,这是基于ICS的售后市场固件。

Alternatively there is a library called support library from google that allows some post-11 API functions (like Fragments ) to be used on older phones. 另外,谷歌有一个名为支持库的库 ,允许在旧手机上使用一些11后API功能(如Fragments )。 For that you need to decrease the minimumversion, and install the support library. 为此,您需要减少minimumversion,并安装支持库。 Check it's docuimetnation whether it is good for you. 检查它是否对你有好处的记录。

Or if you don't want to test it on a live device, then simply use the emulator, as it can emulate all kind of phones, up to Android 4.2 (as of writing this post) 或者,如果您不想在实时设备上测试它,那么只需使用模拟器,因为它可以模拟所有类型的手机,最高可达Android 4.2(截至撰写此帖子时)

  1. Use the emulator to run a virtual Android device running 11+ - This is the preferred solution providing you can do everything you want against the AVD and don't need things like multi-touch or Bluetooth 使用模拟器运行运行11+的虚拟Android设备 - 这是首选解决方案,您可以根据AVD执行所需操作,而不需要多点触控或蓝牙等操作

  2. change back to min version 8 and find another way to accomplish what you want. 改回最低版本8,找到另一种方法来完成你想要的。 This isn't a great solution but sometimes you just have to live with the older code base. 这不是一个很好的解决方案,但有时你只需要使用较旧的代码库。

  3. Root your Desire and install a custom ROM of the desired level. 根据您的愿望并安装所需级别的自定义ROM。 I've done this on my Desire and it's not hard but runs the risk of ruining your device. 我已经在我的欲望上做到了这一点,并不难,但冒着破坏你的设备的风险。 Not really the best reason to Root and mod your phone. 并不是Root和mod手机的最佳理由。

Since support library was also mentioned, I would like to add documentation to how to be backwards compatible 由于还提到了支持库,我想添加如何向后兼容的文档

http://developer.android.com/training/basics/supporting-devices/platforms.html http://developer.android.com/training/basics/supporting-devices/platforms.html

basically you just need to have target SDK version at the level you want to use APIs from and minimum SDK version at whatever you want to support, however you'll need to provide alternate implementation(s) for older platforms or use the support library if it provides the APIs you want (most of the time it does) 基本上你只需要在你想要使用API​​的级别上使用目标SDK版本,并且在你想要支持的任何内容中使用最小的SDK版本,但是你需要为旧平台提供替代实现,或者如果需要为支持库提供支持库。它提供了你想要的API(大部分时间都是这样)

Its very simple dear. 亲爱的,非常简单。 Your application supports api 11(Honey Comb) and your phone's version is 8(Froyo). 您的应用程序支持api 11(Honey Comb),手机版本为8(Froyo)。 So you have to upgrade your phone to api 11(Honey Comb). 因此,您必须将手机升级到api 11(Honey Comb)。

OR 要么

Make your application version to api 8(Froyo). 将您的应用程序版本设置为api 8(Froyo)。 But some new classes supported by api 11 is not available in it. 但是api 11支持的一些新类不可用。

I give you one test thing just try this but not sure for the it will work or not(Its a trick). 我给你一个测试的东西只是尝试这个,但不确定它会工作与否(这是一个技巧)。

Goto "Project Property" file and replace target api 8 to just api 11. 转到“项目属性”文件并将目标api 8替换为api 11。

Cheers. 干杯。

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

相关问题 如果我的目标SDK设置为android 2.2(froyo),我可以在android API 14上运行我的android应用程序吗? - Can i run my android application on android API 14 if my target sdk is set to android 2.2(froyo)? 我找不到连接到PC的htc android设备。 - I can't find my htc android device attached to my PC. 无法在我的HTC设备中从Eclipse运行应用 - Can't run app from Eclipse in my htc device Android:如何在数据库中检索我的期望数据 - Android : How can I retrieve my desire data in my Database Android,StreetView无法在我的设备上正确显示Htc Desire - Android,StreetView not showing correctly on my device Htc Desire 我无法在设备上运行图表 - I can't run chart on my device 当我访问方向传感器(HTC Desire)时,为什么我的Android程序会崩溃? - Why does my Android program crash when I access the Orientation sensor (HTC Desire)? 我无法运行我的应用程序Android Studio - I can not run my application Android Studio 从设备上的 eclipse 运行的应用程序不能单独在设备上运行,我该怎么办? - Application that runs from eclipse on device doesn't run on device alone, what can I do? 我可以在Android Studio中运行API级别7(即eclair)的代码吗? - Can i run my code of API level 7 i.e eclair in android studio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM