0
$\begingroup$

Rosanswers logo

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


Originally posted by vahid on ROS Answers with karma: 31 on 2012-02-12

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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 [email protected] (Damon Kohler)
 * @author [email protected] (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);
    }
  }
}

Originally posted by Alexandr Buyval with karma: 641 on 2012-02-12

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by vahid on 2012-02-20:
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.

Comment by vahid on 2012-02-25:
Hi I wanted to know if i could please get my question answered down below.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by selliott with karma: 51 on 2012-02-17

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by vahid on 2012-02-20:
Hi , since i can not explain the whole thing in the comment box here i explained it down below.

Comment by vahid on 2012-02-25:
Hi, I wanted to know if I could please get my question answered down below.

Comment by kwc on 2012-02-29:
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.

$\endgroup$

Your Answer

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