Java 在Android中使用基本XQJ库时出错

Java 在Android中使用基本XQJ库时出错,java,android,xml,xquery,xqj,Java,Android,Xml,Xquery,Xqj,我正在尝试在Android环境中使用XQuery为此,我下载了库jar并将其包含在我的项目中 当我编译他们提供的示例代码时: import javax.xml.xquery.*; import javax.xml.namespace.QName; import net.xqj.basex.BaseXXQDataSource; public class QuickStart { public static void main(String[] args) throws XQException

我正在尝试在Android环境中使用XQuery为此,我下载了库jar并将其包含在我的项目中

当我编译他们提供的示例代码时:

import javax.xml.xquery.*;
import javax.xml.namespace.QName;
import net.xqj.basex.BaseXXQDataSource;

public class QuickStart
{
  public static void main(String[] args) throws XQException
  {
    XQDataSource xqs = new BaseXXQDataSource();
    xqs.setProperty("serverName", "localhost");
    xqs.setProperty("port", "1984");

    // Change USERNAME and PASSWORD values
    XQConnection conn = xqs.getConnection("USERNAME", "PASSWORD");

    XQPreparedExpression xqpe =
    conn.prepareExpression("declare variable $x as xs:string external; $x");

    xqpe.bindString(new QName("x"), "Hello World!", null);

    XQResultSequence rs = xqpe.executeQuery();

    while(rs.next())
      System.out.println(rs.getItemAsString(null));

    conn.close();
  }
}
Gradle无法生成我的项目,出现以下错误:

Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug]
Error:trouble processing "javax/xml/xquery/ConnectionPoolXQDataSource.class":
Error:Ill-advised or mistaken usage of a core class (java.* or javax.*)
Error:when not building a core library.
Error:This is often due to inadvertently including a core library file
Error:in your application's project, when using an IDE (such as
Error:Eclipse). If you are sure you're not intentionally defining a
Error:core class, then this is the most likely explanation of what's
Error:going on.
Error:However, you might actually be trying to define a class in a core
Error:namespace, the source of which you may have taken, for example,
Error:from a non-Android virtual machine project. This will most
Error:assuredly not work. At a minimum, it jeopardizes the
Error:compatibility of your app with future versions of the platform.
Error:It is also often of questionable legality.
Error:If you really intend to build a core library -- which is only
Error:appropriate as part of creating a full virtual machine
Error:distribution, as opposed to compiling an application -- then use
Error:the "--core-library" option to suppress this error message.
Error:If you go ahead and use "--core-library" but are in fact
Error:building an application, then be forewarned that your application
Error:will still fail to build or run, at some point. Please be
Error:prepared for angry customers who find, for example, that your
Error:application ceases to function once they upgrade their operating
Error:system. You will be to blame for this problem.
Error:If you are legitimately using some code that happens to be in a
Error:core package, then the easiest safe alternative you have is to
Error:repackage that code. That is, move the classes in question into
Error:your own package namespace. This means that they will never be in
Error:conflict with core system classes. JarJar is a tool that may help
Error:you in this endeavor. If you find that you cannot do this, then
Error:that is an indication that the path you are on will ultimately
Error:lead to pain, suffering, grief, and lamentation.
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
Information:BUILD FAILED
Information:Total time: 11.268 secs
Information:34 errors
Information:0 warnings
Information:See complete output in console
如何将此库成功集成到我的项目中?或者有没有更简单的方法在Android中使用XQuery


注:我已经试过了,但是他们提供的下载libray jar的下载链接坏了。

我可能会走火入魔,但我相信在Android上包含一些XML库会有固有的问题,因为它不是JVM。我可能会走火入魔,但我相信在Android上包含一些XML库会有固有的问题,因为它不是JVM。