Android Studio如何启用--core-library标志?

时间:2014-06-13 08:41:36

标签: android gradle android-studio

我有一个项目,我想在我的计算机上配置。

在其他计算机上它可以工作,但只要我使用0.6.1

,就会使用旧版本的Android Studio 0.4.0

但为了使它工作,我必须使用这个标志!我知道在以前的版本中,可以在设置> Android编译器>中启用它。 "添加 - 核心库"旗帜,但在0.6.1我没有找到任何东西......

在gradle中我有下一部分代码:

    dexOptions {
    coreLibrary = true;
}

我该如何修复?也许是因为版本不同..如果是的话那么我应该如何写它才能使它工作?

错误:

Error:Execution failed for task ':BusKg:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    D:\Programms\Programms\adt-bundle-windows-x86_64-20131030\sdk\build-tools\android-4.4\dx.bat --dex --output D:\Android2\BUS.kg\marshrutka\BusKg\build\pre-dexed\debug\annotations-api-6.0.26-27e56569b50edbdd453f9bc0e568cde1fbfa621b.jar C:\Users\Viacheslav\.gradle\caches\modules-2\files-2.1\org.apache.tomcat\annotations-api\6.0.26\50aeafa144ed17913ed44d18ac61afd505a9e3e\annotations-api-6.0.26.jar
Error Code:
    1
Output:
    trouble processing "javax/xml/ws/WebServiceRef.class":
    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.
    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.
    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.
    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.
    1 error; aborting

0 个答案:

没有答案