asked Feb 12
This post is a wiki. Anyone with karma >750 is welcome to improve it.
Hi, I followed the steps in http://ros.org/wiki/ApplicationsPlatform/Clients/Android and installed the android developer tools as explained in here. I Also followed step 4 in creating your own android app, but after hitting rosmake --threads=1 i get the following error on 62nd package make which is my project package that DefaultNodeFactory is not being find. I have copied the error part of the make down below. Also if I do rosmake on any of the tutorial packages they get to compile fine but when I used the steps explained on the website i keep getting this error, so if someone could help me I would really appreciate it.
[rosmake-1] Starting >>> android_test1 [ make ]
[ rosmake ] Last 40 linesdroid_test1: 6... [ 1 Active 62/63 Complete ]
{-------------------------------------------------------------------------------
[echo] Handling Resources...
[aapt] No changed resources. R.java and Manifest.java untouched.
-pre-compile:
-compile: [javac] /home/vahid/ROS_DIR/rosjava_core/rosjava_bootstrap/android.xml:607: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 52 source files to /home/vahid/ROS_DIR/appmanandroid/library/bin/classes [javac] RosActivity.java:48: cannot find symbol [javac] symbol : class DefaultNodeFactory [javac] location: package org.ros.internal.node [javac] import org.ros.internal.node.DefaultNodeFactory; [javac] ^ [javac] SendGoalDisplay.java:59: cannot find symbol [javac] symbol : class DefaultNodeFactory [javac] location: package org.ros.internal.node [javac] import org.ros.internal.node.DefaultNodeFactory; [javac] ^ [javac] RosActivity.java:570: cannot find symbol [javac] symbol: class DefaultNodeFactory [javac] node = new DefaultNodeFactory(nodeMainExecutor.getScheduledExecutorService()).newNode(config); [javac] ^ [javac] SendGoalDisplay.java:206: cannot find symbol [javac] symbol : class DefaultNodeFactory [javac] location: class ros.android.views.SendGoalDisplay [javac] Node newNode = new DefaultNodeFactory().newNode(nc); [javac] ^ [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 4 errors
BUILD FAILED /home/vahid/ROS_DIR/appmanandroid/build_app.xml:116: The following error occurred while executing this line: /home/vahid/android-sdk-linux_x86/tools/ant/build.xml:485: The following error occurred while executing this line: /home/vahid/ROS_DIR/rosjava_core/rosjava_bootstrap/android.xml:587: The following error occurred while executing this line: /home/vahid/ROS_DIR/rosjava_core/rosjava_bootstrap/android.xml:607: Compile failed; see the compiler error output for details.
Total time: 5 seconds
Executing command: ['ant']
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package android_test1 written to:
[ rosmake ] /home/vahid/.ros/rosmake/rosmake_output-20120212-194658/android_test1/build_output.log
[rosmake-1] Finished <<< android_test1 [FAIL] [ 61.48 seconds ]
[ rosmake ] Halting due to failure in package android_test1.
[ rosmake ] Waiting for other threads to complete.
[ rosmake ] Results:
[ rosmake ] Built 63 packages with 1 failures.
[ rosmake ] Summary output to directory
[ rosmake ] /home/vahid/.ros/rosmake/rosmake_output-20120212-194658
answered Feb 17
This post is a wiki. Anyone with karma >750 is welcome to improve it.
This could be caused by having an older version of Rosjava. With the latest version of Rosjava, DefaultNodeFactory can no longer be called with no arguments. RosActivity.java in the appmanandroid library was updated to reflect that. The line where you're getting the error is one that changed.
I would try updating your version of rosjava. Try:
hg pull
hg update
in rosjava_core. If there are any more difficulties in the process for building Android apps let me know. I'm trying to make the documentation as clear as possible.
Maybe you use old version rosjava. I don't see class DefaultNodeFactory in my project. Try compare source from your project with source from my project.
/*
* Copyright (C) 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package myandroid.test_and;
import ros.android.activity.RosAppActivity;
import android.os.Bundle;
import org.ros.node.Node;
import android.util.Log;
import android.widget.Toast;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
//TODO: search for all instances of TODO
/**
* @author damonkohler@google.com (Damon Kohler)
* @author pratkanis@willowgarage.com (Tony Pratkanis)
*/
public class AndroidTest extends RosAppActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
setDefaultAppName("AndroidTest");
setDashboardResource(R.id.top_bar);
setMainWindowResource(R.layout.main);
super.onCreate(savedInstanceState);
//TODO: add code
//Called on creation. ROS hasn't started yet, so don't start
//anything that depends on ROS. Instead, look up things like
//resources. Initialize your layout here.
}
/** Called when the node is created */
@Override
protected void onNodeCreate(Node node) {
super.onNodeCreate(node);
//TODO: Put your initialization code here
}
/** Called when the node is destroyed */
@Override
protected void onNodeDestroy(Node node) {
super.onNodeDestroy(node);
//TODO: Put your shutdown code here for things the reference the node
}
/** Creates the menu for the options */
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.AndroidTest_menu, menu);
return true;
}
/** Run when the menu is clicked. */
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.kill: //Shutdown if the user clicks kill
android.os.Process.killProcess(android.os.Process.myPid());
return true;
//TODO: add cases for any additional menu items here.
default:
return super.onOptionsItemSelected(item);
}
}
}
answered Feb 21
This post is a wiki. Anyone with karma >750 is welcome to improve it.
Hi thanks for the response. When I updated the my rosjava it seems it updated 5 packages and I started creating a new package again and the problem still exist. I still get the same error on the top. @Alexandr: I checked my source code against yours and it seems that everything is the same but I do not know why it gives me this errors. One more thing that I keep having a problem with is that when I walk through one of the tutorial after creating the package and typing rosrun appmanandroid android_create --create ... I run rosinstall ROS_DIR . in which I keep getting errors each time that ros stack is not found. it asks me to either types it in manually in .rosinstall or install the whole ros stack from website using .rosinstall. I do not know to be honest if this would have any impact on this or not. Can you please tell me the step by step to setup rosjava please. I have been working to try to fix this thing right now for weeks, but no success. thanks, Vahid.
1) sudo apt-get install ant ant-contrib maven-ant-helper 2) Install Eclipse and ADT 3) sudo apt-get install python-setuptools 4) sudo easy_install -U rosinstall 5)rosinstall /opt/ros/electric/ros/android https://kforge.ros.org/appmanandroid/hg/raw-file/tip/appman.rosinstall
Alexandr Buyval (Feb 21)editI pushed a change to the appmanandroid library to fix this issue. I did a setup of a whole environment last night and got similar feedback from someone else. We were able to fix this issue on our installations after I updated appmanandroid. So sorry for the issues. Hope it will work now.
selliott (Feb 21)editanswered Feb 23
This post is a wiki. Anyone with karma >750 is welcome to improve it.
Now I am getting another error regarding Target "nodeps" does not exist in the project "android_gingerbread how should I fix this thanks. Vahid.
I ran into the same issue awhile ago while trying to build the existing android apps. The API (rosjava) has been refactored, but the apps haven't been updated to reflect it yet. I just pulled a pre-refactor version of rosjava, but it sounds like someone else in this thread has committed a more permanent fix.
answered Feb 23
This post is a wiki. Anyone with karma >750 is welcome to improve it.
By applying the patch mentioned on the website it seems I fixed this error, but it seems that another error occurred which is in regards to {build.Target} not being found or something. I wanted to know how should fix this error now. Thanks, Vahid.
Is it possible that you're missing components of the Android SDK? Try running the 'android' command with no arguments. The AVD Manager should come up. Make sure you have all the API levels selected. Remember to check the box for obsolete packages so you can install API 9 if it's missing.
selliott (Feb 23)editanswered Feb 23
This post is a wiki. Anyone with karma >750 is welcome to improve it.
export ROS_ROOT=/opt/ros/electric/ros export PATH=$ROS_ROOT/bin:$PATH export PYTHONPATH=$ROS_ROOT/core/roslib/src:$PYTHONPATH export PATH=$PATH:/home/vahid/android-sdk-linux_x86/tools:/home/vahid/android-sdk-linux_x86/platform_tools if [ ! "$ROS_MASTER_URI" ] ; then export ROS_MASTER_URI=http://localhost:11311 ; fi export ROS_PACKAGE_PATH=/home/vahid/ros_workspace:/opt/ros/electric/stacks:/home/vahid/ROS_DIR/turtlebot:/home/vahid/ROS_DIR/appmanwx:/home/vahid/ROS_DIR/android_voice_recognition:/home/vahid/ROS_DIR/rosjava_android:/home/vahid/ROS_DIR/android_pr2_props:/home/vahid/ROS_DIR/android_pan_tilt:/home/vahid/ROS_DIR/android_map_nav:/home/vahid/ROS_DIR/android_make_a_map:/home/vahid/ROS_DIR/android_map_manager:/home/vahid/ROS_DIR/android_app_chooser:/home/vahid/ROS_DIR/android_teleop:/home/vahid/ROS_DIR/appmanandroid:/home/vahid/ROS_DIR/rosjava_core:/opt/ros/electric/stacks export ROS_WORKSPACE=/home/vahid/ROS_DIR
answered Feb 23
This post is a wiki. Anyone with karma >750 is welcome to improve it.
BUILD FAILED /home/vahid/ROS_DIR/appmanandroid/build_app.xml:116: The following error occurred while executing this line: /home/vahid/android-sdk-linux_x86/tools/ant/build.xml:485: The following error occurred while executing this line: /home/vahid/ROS_DIR/rosjava_core/rosjava_bootstrap/android.xml:472: The following error occurred while executing this line: Target "${build.target}" does not exist in the project "android_gingerbread".
Total time: 1 second
Executing command: ['ant']
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package android_app_chooser written to:
[ rosmake ] /home/vahid/.ros/rosmake/rosmake_output-20120223-144231/android_app_chooser/build_output.log
[rosmake-0] Finished <<< android_app_chooser [FAIL] [ 52.48 seconds ]
[ rosmake ] Halting due to failure in package android_app_chooser.
[ rosmake ] Waiting for other threads to complete.
[ rosmake ] Results:
[ rosmake ] Built 63 packages with 1 failures.
[ rosmake ] Summary output to directory
[ rosmake ] /home/vahid/.ros/rosmake/rosmake_output-20120223-144231
answered Feb 23
This post is a wiki. Anyone with karma >750 is welcome to improve it.
-compile: [javac] /home/vahid/ROS_DIR/rosjava_core/rosjava_bootstrap/android.xml:607: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [echo] Creating library output jar file... Trying to override old definition of task dex-helper
nodeps:
-setup: [echo] Gathering info for AppManAndroid... [setup] Android SDK Tools Revision 16 [setup] Project Target: Android 2.3.1 [setup] API level: 9 [setup] Project Type: Android Library [setup] [setup] ------------------ [setup] Resolving library dependencies: [setup] /home/vahid/ROS_DIR/appmanandroid/library: ../../rosjava_android/android_gingerbread/. => /home/vahid/ROS_DIR/rosjava_android/android_gingerbread [setup] ------------------ [setup] Ordered libraries: [setup] /home/vahid/ROS_DIR/rosjava_android/android_gingerbread [setup] ------------------ [setup]
-build-setup: [echo] Building Libraries
BUILD FAILED /home/vahid/ROS_DIR/appmanandroid/build_app.xml:116: The following error occurred while executing this line: /home/vahid/android-sdk-linux_x86/tools/ant/build.xml:485: The following error occurred while executing this line: /home/vahid/ROS_DIR/rosjava_core/rosjava_bootstrap/android.xml:472: The following error occurred while executing this line: Target "${build.target}" does not exist in the project "android_gingerbread".
Total time: 1 second
Executing command: ['ant']
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package android_app_chooser written to:
[ rosmake ] /home/vahid/.ros/rosmake/rosmake_output-20120223-144231/android_app_chooser/build_output.log
[rosmake-0] Finished <<< android_app_chooser [FAIL] [ 52.48 seconds ]
[ rosmake ] Halting due to failure in package android_app_chooser.
[ rosmake ] Waiting for other threads to complete.
[ rosmake ] Results:
[ rosmake ] Built 63 packages with 1 failures.
[ rosmake ] Summary output to directory
[ rosmake ] /home/vahid/.ros/rosmake/rosmake_output-20120223-144231
Asked: Feb 12
Seen: 273 times
Last updated: Feb 23
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.