Android的DX工具 [英] Android dx tool

查看:181
本文介绍了Android的DX工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有人知道任何文档DX的? 特别是我想知道什么--core库选项执行。任何人都可以摆脱任何光线上?

Does anyone know of any documentation for dx? In particular I am interested in knowing what the --core-library option does. Can anybody shed any light on that?

谢谢!

推荐答案

这是一个特殊用途的标志,建立了一些框架罐子(core.jar添加,framework.jar等)时才使用。通常情况下,DX将拒绝处理任何Java *或使用javax。*类。所以这个选项用于core.jar添加,所有的这些类被实际的定义。

This is a special purpose flag that is only used when building some of the framework jars (core.jar, framework.jar, etc.). Normally, dx will refuse to process any java.* or javax.* classes. So this option is used for core.jar, where all those classes are actually defined.

下面是从DX源(Dalvik的/ DX / src目录/ COM /安卓/ DX /命令/ dexer / Main.java),即会打印,如果你尝试包括一个java。*或使用javax。*类相关的Blurb在应用程序

Here's a relevant blurb from the dx source (dalvik/dx/src/com/android/dx/command/dexer/Main.java), that gets printed if you try to include a java.* or javax.* class in an application.

不明智或核心类错误的使用(Java。*或使用javax。*)   如果没有建立一个核心库。   这往往是由于在不经意间,包括一个核心库文件   在你的应用程序的项目,使用IDE时(如   蚀)。如果你确定你不是故意定义   核心类,那么这是一个什么样的最可能的解释   怎么回事。

Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. This is often due to inadvertently including a core library file in your application's project, when using an IDE (such as Eclipse). If you are sure you're not intentionally defining a core class, then this is the most likely explanation of what's going on.

不过,你实际上可能试图在核心定义一个类   命名空间,它的你可能已经采取了例如源,   从一个非Android虚拟机项目。这将最   肯定不行的。至少,它损害了   该平台的未来版本您的应用程序的兼容性。   这是值得商榷的合法性也经常。

However, you might actually be trying to define a class in a core namespace, the source of which you may have taken, for example, from a non-Android virtual machine project. This will most assuredly not work. At a minimum, it jeopardizes the compatibility of your app with future versions of the platform. It is also often of questionable legality.

如果你真的打算建立一个核心库 - 这是唯一   合适的,创建一个完整的虚拟机的一部分   分布,而不是编译应用程序 - 然后使用   在\ - 核心库\选项晚饭preSS此错误消息。   如果你继续使用\ - 核心库\,但实际上   构建一个应用程序,然后谅解,您的应用程序   将仍然无法生成或运行,在某些时候。请   prepared为愤怒的客户谁找到,例如,您的   应用程序停止运行,一旦他们提升自己的工作   系统。你会责怪这个问题。

If you really intend to build a core library -- which is only appropriate as part of creating a full virtual machine distribution, as opposed to compiling an application -- then use the \"--core-library\" option to suppress this error message. If you go ahead and use \"--core-library\" but are in fact building an application, then be forewarned that your application will still fail to build or run, at some point. Please be prepared for angry customers who find, for example, that your application ceases to function once they upgrade their operating system. You will be to blame for this problem.

如果您是合法使用一些code恰好是在   核心包,那么最简单安全的替代你是   重新包装一下code。也就是说,移动类问题成   你自己的包的命名空间。这意味着他们将永远不会在   冲突的核心系统类。 JarJar是一种工具,可以帮助   您在这方面。如果你发现你不能做到这一点,那么   即表明该路径你在将最终   导致疼痛,痛苦,悲伤和悔恨。

If you are legitimately using some code that happens to be in a core package, then the easiest safe alternative you have is to repackage that code. That is, move the classes in question into your own package namespace. This means that they will never be in conflict with core system classes. JarJar is a tool that may help you in this endeavor. If you find that you cannot do this, then that is an indication that the path you are on will ultimately lead to pain, suffering, grief, and lamentation.

这篇关于Android的DX工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆