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

Error building Android app with rosjava

asked 2016-02-09 13:46:14 -0600

droberts42 gravatar image

We are currently creating an Android app running on a Tango and want to publish data (pose and point cloud) to a ROS Indigo node generated on the Tango. We are also using Android Studio version 1.5.1 on Ubuntu 14.04 to develop this app.

From what we understand we will need to modify the .gradle files associated with the Android project in order so we can point to the ROSJava libraries.

We understand from the No Ros Installation tutorial ( http://wiki.ros.org/rosjava/Tutorials... there is a Maven repository where the relevant dependencies are stored.

This is our app-level .gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.projecttango.experiments.nativepointcloud"
        minSdkVersion 19
        targetSdkVersion 19
    }

    sourceSets.main {
        jniLibs.srcDir 'src/main/libs'
        jni.srcDirs = [];
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn ndkBuild
}

task ndkBuild(type: Exec) {
    Properties properties = new Properties()
    properties.load(project.rootProject.file('local.properties').newDataInputStream())
    def ndkbuild = properties.getProperty('ndk.dir', null)+"/ndk-build"
    commandLine ndkbuild, '-C', file('src/main/jni').absolutePath
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'org.ros.rosjava_core:rosjava:0.1.+'
}

Global build.gradle file:

buildscript {

repositories {
    maven {
        url "https://github.com/rosjava/rosjava_mvn_repo/raw/master"
    }
    mavenLocal()
    mavenCentral()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

we are unable to import the relevant ROSJava classes as we get the error

Error:(38, 13) Failed to resolve: org.ros.rosjava_core:rosjava:0.1.+

Have we missed something out?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-07-18 01:19:16 -0600

Tav_PG gravatar image

updated 2019-07-21 20:52:28 -0600

Try and replace:

compile 'org.ros.rosjava_core:rosjava:0.1.+'

with:

compile 'org.ros.rosjava_core:rosjava:0.3.6'

and (if you need messages)...:

compile 'org.ros.rosjava_messages:sensor_msgs:1.12.7'
compile 'org.ros.rosjava_messages:std_msgs:0.5.11'
compile 'org.ros.rosjava_messages:geometry_msgs:1.12.7'

If the above does not work then look at: https://github.com/rosjava/rosjava_co...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-02-09 13:46:14 -0600

Seen: 1,045 times

Last updated: Jul 21 '19