库 | JAR文件 | 依赖 | RAD Studio需要 |
Android Support | android-support-v4.jar | 是 | |
FireMonkey | fmx.jar | Android Support | 是 |
Google Mobile Ads | GoogleAdMobAdsSdk-6.4.1.jar | 否 | |
Google Analytics | google-analytics-v2.jar | 否 | |
Google Play Application Licensing | google-play-licensing.jar | 否 | |
Google Play In-app Billing | google-play-billing.jar | Google Play Application Licensing | 否 |
Google Play Services | google-play-services.jar | Google Play Application Licensing | 否 |
APK Expansion | apk-expansion.jar | FireMonkey | 否 |
Google Play Application Licensing | |||
Cloud Messaging | cloud-messaging.jar | FireMonkey | 否 |
Google Play Application Licensing |
你可以找到这些JAR文件在RAD Studio安装文件夹(C:\Program Files (x86)\Embarcadero\Studio\19.0):
lib\android\debug
lib\android\release
你也可以包含所有RAD Studio内置的java库到你的classes.dex文件或限定,你的应用RAD Studio内置Java库基于上边表格的信息。
警告:在你自定义的classes.dex文件中,你必须包含RAD Studio所必须的Java库。
从JAR文件生成一个classes.dex文件
一旦你已经确定你的Android应用程序需要的JAR文件,你可以从他们创建classes.dex文件。
创建一个classes.dex文件,你需要使用命令行工具DX。你可以在C:\Users\Public\Documents\Embarcadero\Studio\19.0\PlatformSDKs\adt-bundle-windows-x86-20131030\sdk找到这个命令行工具。
用--dex参数运行DX,运用 --output parameter 参数输出classes.dex路径,注意用空格隔开
dx --dex --output="classes.dex" "C:\Path\To\Library1.jar" "C:\Path\To\Library2.jar"
注意:你必须创建 debug 和 release两个版本的classes.dex文件。如果部署的classes.dex文件为Debug,RAD Studio内置的java库的RAD Studio debug功能才可用
部署classes.dex文件
警告:小心地遵循以下步骤。Android应用程序都必须包含一个有效的classes.dex文件。更多信息,见下面的文件丢失或无效classes.dex。
为配置你的安卓应用,需要部署你的自定义 classes.dex文件。
1、选择Project > Deployment打开Deployment Manager。
2、取消默认的classes.dex文件复选框。
3、点击“添加文件”按钮,添加自定义classes.dex文件到配置文件列表。
4、修改你的新条目远程路径 classes\
5、修改Platforms为只为Android
故障排除
classes.dex文件无效或丢失
当你使用RAD Studio并且你的应用中没有一个有效的classes.dex文件时运行Android应用,出现这个信息:
Unable to create process: Unable to install ''. Failure [INSTALL_FAILED_DEXOPT]
一个Android应用程序包(APK文件)必须包含一个有效的classes.dex文件。这是:
在APK中必须有一个classes.dex文件
在APK文件中,classes.dex文件必须位于classes/classes.dex
classes.dex必须是一个有效的 Dalvik可执行文件
当你使用一个自定义的classes.dex文件,你必须小心。
当你在 Deployment Manager中取消默认的classes.dex文件并添加自定义classes.dex文件:
请确保您的自定义文件已勾选
请确保Remote Path路径为classes\
确保你的新条目是你的classes.dex文件,并且是Dalvik可执行文件
如果你的Android应用程序的配置不需要部署一个有效的classes.dex文件,你运行你的应用程序从RAD Studio Android设备或安装在您的设备与RAD Studio生成应用程序的APK文件,安装程序将失败,但它会让数据在你的Android设备防止你安装应用程序同样的包的名称作为你的应用(如Android版本信息)。
当你试图安装一个没有有效的classes.dex文件的APK文件时,唯一的办法是在安卓设备上恢复出厂设置。
警告:出厂重置从设备中删除所有日期(个人数据、自定义设置等等)。仔细考虑是否固定的问题是值得失去你的数据。如果您决定继续前进,请记住在执行出厂重置之前备份数据。
Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号
执行时间: 0.084310054779053 seconds