简体   繁体   English

android app部署问题

[英]android app deployment issue

i had an android app and the target for the app i selected is Android 4.0.3 API Level 15. 我有一个Android应用程序,我选择的应用程序的目标是Android 4.0.3 API等级15。

And by connecting an android phone to my machine i copied the apk file from my machine to the phone. 通过将Android手机连接到我的机器,我将apk文件从我的机器复制到手机。

But the problem is the phone that am using for testing the app is on Android version 2.3.6 installed. 但问题是用于测试应用的手机是安装在Android 2.3.6版本上的。

I think thats why when am double click on the apk file to install on device it is showing an error like There is a problem parsing the package . 我想这就是为什么当我双击apk文件安装在设备上时,它显示错误,如There is a problem parsing the package

How can it be solved.? 怎么解决呢?

In your manifest include a minimum SDK version along with your target like this: 在您的清单中包含最低SDK版本以及您的目标,如下所示:

<uses-sdk android:minSdkVersion="4" />
<uses-sdk android:targetSdkVersion="15" />

在你的清单中你必须改变minsdkversion以适应测试手机,否则它将无法工作。

Be careful how you do this as obviously many classes have been added to Android between v2.3.x and 4.x. 请注意如何执行此操作,因为很明显,许多类已在v2.3.x和4.x之间添加到Android中。 Not only that but even classes which existed for 2.3.x may have had methods and/or constants added to them. 不仅如此,即使是2.3.x中存在的类也可能已经添加了方法和/或常量。

As others have said, simply set your min and target SDK manifest entries but be aware that if you use any classes only available after v2.3.x, you will get runtime exceptions when trying to test. 正如其他人所说,只需设置你的min和目标SDK清单条目,但要注意,如果你使用v2.3.x之后只能使用的任何类,你将在尝试测试时获得运行时异常。

In general I can see you running into trouble - if you really need the 4.x API then you will never be able to test on the 2.3.6 device and you will have to use an emulator. 一般来说,我可以看到你遇到麻烦 - 如果你真的需要4.x API,那么你永远无法在2.3.6设备上进行测试,你将不得不使用模拟器。 If, on the other hand, you will only be using classes available in v2.3.x then there is no point in targeting v4.x at all. 另一方面,如果您只使用v2.3.x中提供的类,那么根本不需要针对v4.x。 In that case simply target v2.3.x instead. 在这种情况下,只需针对v2.3.x。

如果你想在你的mopbile中运行APK,你需要设置minSDK版本2.3

App is build for Android 4.0.3 API level 15, You must set minSDKVersion in manifest file of the project. 应用程序是为Android 4.0.3 API级别15构建的,您必须在项目的清单文件中设置minSDKVersion。 By setting minSDKVersion app will run on all later Android OS versions. 通过设置minSDKVersion应用程序将在所有后来的Android OS版本上运行。 For example if you set it to 7, app will run on API Level 7 onwards. 例如,如果将其设置为7,则app将在API级别7上运行。 Not on 3, 4, 5 or 6. 不在3,4,5或6。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM