有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何在安卓 studio中使用调用jaxws web服务的jar文件

我试图在Android Studio上使用调用jax ws web服务的jar文件

我知道有AndroidStudio的ksoap2库,但我有一个客户端web服务jar文件可以在AndroidStudio上使用

我已经在eclipse中的简单java项目上尝试了这个jar文件(我已经添加了库)[axis.jar、commons-discovery-0.2.jar、commons-logging.jar、javamail-mailapi-1.4.jar、jaxrpc.jar、saaj.jar、wsdl4j.jar],效果很好

在安卓studio上,我用jar文件添加了上述库

当我运行应用程序时,我遇到了以下错误:

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. com.安卓.build.api.transform.TransformException: com.安卓.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/ECLIPSE_.SF File1:

/home/user/Desktop/TestWebServiceCalling/app/libs/wsdl4j.jar File2: /home/user/Desktop/TestWebServiceCalling/app/libs/commons-logging.jar

删除两个库文件(wsdl4j.jar、commons logging.jar)后,我遇到了以下错误:

To run dex in process, the Gradle daemon needs a larger heap. Itcurrently has approximately 989 MB. For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB. To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties. For more information see https://docs.gradle.org/current/userguide/build_environment.html Error:trouble processing "javax/xml/messaging/Endpoint.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 :app:transformClassesWithDexForDebug FAILED Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

提前谢谢你


共 (0) 个答案