Ask Your Question
0

creating my first android app : DefaultNodeFactory symbol not found. [closed]

asked Feb 12

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated Feb 20

anonymous user

Anonymous

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

delete reopen flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by kwc
close date 2012-02-29 13:41:06

9 Answers

Sort by ยป oldest newest most voted
1

answered Feb 17

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated Feb 17

selliott gravatar image selliott
51 2

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.

link delete flag offensive edit

Comments

Hi , since i can not explain the whole thing in the comment box here i explained it down below.

vahid (Feb 21)edit

Hi, I wanted to know if I could please get my question answered down below.

vahid (Feb 25)edit

Please edit your original question or post new questions if the original question is answered. I am closing this post because this is now unanswerable given the multiple threads here.

kwc (Feb 29)edit
0

answered Feb 13

Alexandr Buyval gravatar image Alexandr Buyval flag of Russian Federation
224 2 9

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);
    }
  }
}
link delete flag offensive edit

Comments

thanks for the response, it actually was the same. since i can not leave a lot of comments here i explained it down below. thanks.

vahid (Feb 21)edit

Hi I wanted to know if i could please get my question answered down below.

vahid (Feb 25)edit
0

answered Feb 21

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated Feb 21

vahid gravatar image vahid
16 1 2

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.

link delete flag offensive edit

Comments

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)edit

1) sudo apt-get install ant ant-contrib maven-ant-helper

Alexandr Buyval (Feb 21)edit

I 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)edit
0

answered Feb 23

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated Feb 23

vahid gravatar image vahid
16 1 2

Now I am getting another error regarding Target "nodeps" does not exist in the project "android_gingerbread how should I fix this thanks. Vahid.

link delete flag offensive edit
0

answered Feb 23

brianpen gravatar image brianpen
151 4 10

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.

link delete flag offensive edit
0

answered Feb 23

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated Feb 23

vahid gravatar image vahid
16 1 2

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.

link delete flag offensive edit

Comments

I don't think I've seen that error before. Do you think you could post more detail? I'll see if I can replicate it.

selliott (Feb 23)edit

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)edit

Maybe double check your environment variables too.

selliott (Feb 23)edit

I ran the android command and once the window popped up I was able to see almost all of the SDKs to be installed, even those that were obsolete like API9.

vahid (Feb 23)edit

What should I check as far as environment variables?

vahid (Feb 23)edit
0

answered Feb 23

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated Feb 23

vahid gravatar image vahid
16 1 2

!/usr/bin/env sh

THIS IS A FILE AUTO-GENERATED BY rosinstall

IT IS UNLIKELY YOU WANT TO EDIT THIS FILE BY HAND

IF YOU WANT TO CHANGE THE ROS ENVIRONMENT VARIABLES

USE THE rosinstall TOOL INSTEAD.

see: http://www.ros.org/wiki/rosinstall

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

link delete flag offensive edit

Comments

As far as I can see your environment variables look fine. What is the exact error you're getting? Also, you mentioned that you saw all the SDK components. Did they say "Installed" next to them?

selliott (Feb 23)edit

yes it said install next to the SDKs only the things like examples and so on were on installed.

vahid (Feb 23)edit

I just copied the part regarding the build Failed in the answer you question part down below.

vahid (Feb 23)edit
0

answered Feb 23

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated Feb 23

vahid gravatar image vahid
16 1 2

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

link delete flag offensive edit

Comments

actually I added the whole thing down below after it fails in package 62/63.

vahid (Feb 23)edit
0

answered Feb 23

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated Feb 23

vahid gravatar image vahid
16 1 2

-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

link delete flag offensive edit

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: Feb 12

Seen: 273 times

Last updated: Feb 23