0
$\begingroup$

Rosanswers logo

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'

repositories {
    maven {
        url 'https://github.com/rosjava/rosjava_mvn_repo/raw/master'
    }
    mavenCentral() }

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 13
        targetSdkVersion 19
    } }

dependencies {  compile 'com.android.support:appcompat-v7:+'
    compile 'org.ros.android_core:android_gingerbread_mr1:0.1.+'
    compile 'org.ros.android_core:android_honeycomb_mr2:0.1.+'
    compile 'org.ros.rosjava_core:rosjava:0.1.+' }

Originally posted by Lunbo on ROS Answers with karma: 93 on 2014-01-05

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.+'

Originally posted by Lunbo with karma: 93 on 2014-01-12

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Daniel Stonier on 2014-06-22:
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.

Comment by kilmarnock on 2014-09-16:
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)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.