Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to build ros2_android_examples #11

Open
AviKenz opened this issue Jun 1, 2020 · 3 comments
Open

unable to build ros2_android_examples #11

AviKenz opened this issue Jun 1, 2020 · 3 comments

Comments

@AviKenz
Copy link

AviKenz commented Jun 1, 2020

Hallo,

First i want to thank you for what you have done and apologize for my english. im not a native speaker...

im trying to develop an android app which communicate with ros2 for my master thesis. and im facing some issues... a lot ! im struggling with them since 3 days now :(

i followed your instructions more than 12 times. but i am always blocked anyhow.

the ament part works fine by me. so i can build it without problems. but when building the android part (ament build .....) i get many warnings like this:

[ 4%] Building CXX object src/cpp/CMakeFiles/fastrtps.dir/utils/IPFinder.cpp.o
-- Looking for pthread_setaffinity_np in pthread
-- Looking for pthread_setaffinity_np in pthread - not found
-- Platform has not PTHREAD_SETAFFINITY_NP
In file included from /home/avikenz/Masterarbeit/Workspace/ros2_android/src/eProsima/Fast-RTPS/src/cpp/utils/IPFinder.cpp:20:
In file included from /home/avikenz/Masterarbeit/Workspace/ros2_android/src/eProsima/Fast-RTPS/include/fastrtps/utils/IPFinder.h:28:
/home/avikenz/Masterarbeit/Workspace/ros2_android/src/eProsima/Fast-RTPS/include/fastrtps/utils/../rtps/common/Locator.h:346:13: warning:
ignoring return value of function declared with 'warn_unused_result'
attribute [-Wunused-result]
std::remove(m_locators.begin(), m_locators.end(), loc);
^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)

but the build process continue continues despite the warning BUT at the end i have following message: Failed packages: rcljava_common

I had to downgrade to java 8 and i took exactly the same NDK version like you (16b).

i tried to continue despite the "unsuccesfull" build by opening an android_example (in android studio) but....

  • i get some gradle related issues which i resolve by changing distributionUrl located in local.properties (i enter an url with a lower version 3.3). after that the gradle proceed fine

  • i also have a "cannot resolve symbol" error on every org.ros2.xx.xxx.xx classes. I resolved them by adding the classes manually to the project (its normal like this ? i thought the ros2 classes would be recognised automatically... maybe im wrong)

  • i also have an "cannot resolve std_msgs" error in TalkerNode.java. i dont know how i can resolve that

when i try to build the project despite the unresolved error about std_msgs, i get the following:Missing Ament Gradle property: ament.build_space. im not getting any gradle.properties file as you mentioned HERE and i have no idea how to fix or workaround this error.

I need your help PLEASE !!!!!

ubuntu: 18.04 Bionic
NDK: 16b
SDK: 29
gradle: 4.4.1
jdk: 8
Android Sutio: lastest

my email: [email protected]

THANK IN ADVANCE

@esteve
Copy link
Member

esteve commented Jun 2, 2020

@AviKenz first of all, do not send me emails to my personal email address just to notify me to have a look at this issue, which you had just opened, it's bad etiquette. You sent me TWO emails 10 minutes after opening this issue, that's not how opensource works at all.

Anyway, could you paste the entire log output? It seems Fast-RTPS for Android can't be built on your system for some reason.

Additionally, could you type the following and paste the output?

cd /home/avikenz/Masterarbeit/Workspace/ros2_android/src/
vcs export

Thanks.

@AviKenz
Copy link
Author

AviKenz commented Jun 2, 2020

Hello @esteve,
oooh sorry ! i just wanted to wake your attention. its the first time i deal with git issues.

im glad you answer SOOO FAST ! :) :) :)

the requested logs:
build_log_full.txt
vcs_log.txt

the build script (almost same as in your instructions. i just change the worspace paths):
build.txt

i also set JAVA_HOME, ANDROID_HOME and ANDROID_NDK in /etc/environment:
etc_env.txt

THANK IN ADVANCE ! :)

@pengzhouhu
Copy link

pengzhouhu commented Dec 16, 2021

@AviKenz

  1. " Could NOT find OpenSSL, try to set the path to OpenSSL root folder ".
    maybe you need build openssl on arm64, and add the environment OPENSSL_ROOT_DIR and OPENSSL_CRYPTO_LIBRARY in build.sh,i think this can solve your problem

  2. "i also have a "cannot resolve symbol" error on every org.ros2.xx.xxx.xx classes."
    this problem maybe you don`t install rclandroid.aar to the install folder, command like this:

 gradle assembleRelease
 gradle deployArtifacts

holp can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants