ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Error while Run 'All tests' in a simple android ros project in Ubuntu

asked 2014-01-05 18:08:56 -0500

Lunbo gravatar image

updated 2014-01-12 19:17:08 -0500

I am doing a simple android app using Ros in Android Studio. I followed the tutorial 'Installation-Android Studio Development Environment' http://wiki.ros.org/android/Tutorials/hydro/Installation%20-%20Android%20Studio%20Development%20Environment

Everything was good and I successfully compiled it. But then I got an error when I tried to Run it. After that, I couldn't compile it successfully anymore.

Gradle: trouble processing "javax/xml/parsers/DocumentBuilder.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

Error:Gradle: Execution failed for task ':MyApplication:dexDebug'.  Could not call IncrementalTask.taskAction() on task ':MyApplication:dexDebug'

I searched for the solution and it seems that i need to exclude some dependencies but I don't know which one need to be exclude and why. I only depends on what the tutorial asked me to do. I don't know which one conflict with the core library.

Can anybody help me solve this? the project compiled successfully. FYI: Ubuntu 12.04 Android Studio 0.3.2 Android API 19 Gradle 0.6.+

here is the the sub project build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.+'
    } } apply plugin: 'android ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-01-12 19:13:40 -0500

Lunbo gravatar image

For those who may concern, I solved this problem by:

1: upgrade to Android Studio 0.4 and Gradle 0.7

2: using

compile('org.ros.android_core:android_honeycomb_mr2:0.1.+'){
        exclude group: 'junit'
        exclude group: 'xml-apis'
    }

instead of

compile 'org.ros.android_core:android_honeycomb_mr2:0.1.+'
edit flag offensive delete link more

Comments

That's curious. I wonder why this started happening. I also wonder if it inadvertantly causes any problems leaving out the xml-apis and if we can actually deal with it at a lower level.

Daniel Stonier gravatar image Daniel Stonier  ( 2014-06-22 09:31:30 -0500 )edit
1

compile ('org.ros.rosjava_core:rosjava:[0.1,0.2)'){ exclude group: 'junit' exclude group: 'xml-apis', module: 'xml-apis' }

to add the lines above did help me now (AS 0.8.x, Gradle 1.12)

kilmarnock gravatar image kilmarnock  ( 2014-09-16 10:44:04 -0500 )edit

Question Tools

Stats

Asked: 2014-01-05 18:08:56 -0500

Seen: 2,409 times

Last updated: Jan 12 '14