Closed OlivierGre closed 3 years ago
I'm now using
ANDROID_ABI=arm64-v8a ANDROID_NDK_HOME=/local/android/Sdk/ndk/22.1.7171670 ./build-commissioner-libs.sh
I don't have anymore error but it never ends so I guess that something is failing. Is there a way to see what's going on?
By the way, I had to use a root account otherwise I had an error message.
ANDROID_NDK_HOME=/local/android/Sdk/ndk/22.1.7171670
This is correct.
ANDROID_ABI=arm64-v8a ANDROID_NDK_HOME=/local/android/Sdk/ndk/22.1.7171670 ./build-commissioner-libs.sh
There is absolutely no output
Here is the output when not running as root:
ANDROID_ABI=arm64-v8a ANDROID_NDK_HOME=/local/android/Sdk/ndk/22.1.7171670 ./build-commissioner-libs.sh
CMake Error at CMakeLists.txt:30 (project):
Running
'/usr/sbin/ninja' '--version'
failed with:
die: error: must run as root
-- Configuring incomplete, errors occurred!
See also "/local/MMY_GIT/android/ot-commissioner/android/.build-arm64-v8a/CMakeFiles/CMakeOutput.log".
Here is the content of CMakeOutput.log:
The target system is: Android - 1 - aarch64
The host system is: Linux - 4.4.0-210-generic - x86_64
I will expect ninja
being installed in /usr/bin
but not /usr/sbin
.
Did you install ninja
with ./script/bootstrap.sh
?
If I remember correcly, I have installed it with "sudo apt-get install ninja". Is this location (in /usr/sbin) an issue?
BTW, I haven't used the script "./script/bootstrap.sh". Did I miss something?
I don't think a non-root user has the permission to run binaries in /usr/sbin
, that's why you need to run ./build-commissioner-libs.sh
as root.
You should run ${OT_COMMISSIONER_ROOT_DIR}/script/bootstrap.sh
before trying anything else, I updated ./build-commissioner-libs.sh
to always run script/bootstrap.sh
: ./build-commissioner-libs.sh
: https://github.com/openthread/ot-commissioner/pull/216.
I have uninstalled ninja with:
apt remove ninja-build
Then I have called "./script/bootstrap.sh" and it has installed ninja. I now have it here:
which ninja
/usr/bin/ninja
This is fixing the issue. I then get another issue :
CMake Error at /usr/local/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find SWIG: Found unsuitable version "3.0.8", but required is at
least "4.0" (found /usr/bin/swig, )
I need to reinstall the packages properly.
You should run ${OT_COMMISSIONER_ROOT_DIR}/script/bootstrap.sh before trying anything else,
You may want to update https://github.com/openthread/ot-commissioner/blob/main/android/BUILDING.md
I updated ./build-commissioner-libs.sh to always run script/bootstrap.sh: ./build-commissioner-libs.sh: #216.
"bootstrap.sh" requires root privilege (in order to install some packages). That might be a problem if you call it every times from "build-commissioner-libs.sh". People like me have to contact the "IT" to get someone call the script with root privilege. That would be nice if only the installation of the dependencies require root privilege. For the rest, we could call "build-commissioner-libs.sh" without root privilege.
"bootstrap.sh" requires root privilege (in order to install some packages). That might be a problem if you call it every times from "build-commissioner-libs.sh". People like me have to contact the "IT" to get someone call the script with root privilege. That would be nice if only the installation of the dependencies require root privilege. For the rest, we could call "build-commissioner-libs.sh" without root privilege.
Makes sense to me, updated.
CMake Error at /usr/local/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find SWIG: Found unsuitable version "3.0.8", but required is at least "4.0" (found /usr/bin/swig, )
I need to reinstall the packages properly.
What's your linux distribution and version? And how did you fix it?
Makes sense to me, updated.
Thanks
What's your linux distribution and version? And how did you fix it?
I'm on an "old" Ubuntu 16.04. I haven't fixed it yet. I had the same problem with cmake and I had to download the source rebuild it and install it. I will probably have to do the same here.
And how did you fix it?
I have followed the instructions here: https://www.dev2qa.com/how-to-install-swig-on-macos-linux-and-windows/
I now have the version 4.0.2.
I'm reaching another error:
CMake Error at third_party/CMakeLists.txt:42 (add_subdirectory):
The source directory
/local/MMY_GIT/android/ot-commissioner/third_party/fmtlib/repo
does not contain a CMakeLists.txt file.
NB: There are several errors like this (+ some warnings).
I attach the full log. log.txt
I suspect that it is because I have jumped straight into the compilation of the Android App. I might have to build some third party libraries first. Can you please point me the procedure? Thanks
The script/bootstrap.sh
will checkout submodules for you at the end of the file. I will suggest you edit the script to comment out the swig
from sudo apt-get install...
list and rerun ./build-commissioner-libs.sh
.
If the similar error still appears, run below command and then try again ./build-commissioner-libs.sh
:
git submodule foreach --recursive git checkout master
Sorry for the late answer, I was out of the office.
The problem was due to the fact that I had used
git clone https://github.com/openthread/ot-commissioner.git
instead of
git clone https://github.com/openthread/ot-commissioner.git --recursive
build-commissioner-libs.sh is now successful.
Concerning bootstrap script, would it be possible to split it in two scripts? One installing dependencies (and thus requiring root privilege) and one for the rest (like the update of git sub modules).
A side comment: At the end of bootstrap script, there is this command which is failing on my side:
git submodule update --init --recursive --depth=1 --progress
usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
or: git submodule [--quiet] init [--] [<path>...]
or: git submodule [--quiet] deinit [-f|--force] [--] <path>...
or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--reference <repository>] [--recursive] [--] [<path>...]
or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
or: git submodule [--quiet] foreach [--recursive] <command>
or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
This is not a blocking issue right now because I have juste cloned the repository so all the submodules are uptodate.
At the end of bootstrap script, there is this command which is failing on my side:
This is probably because your git version is too old. Try updating the git package.
I have the most recent version of GIT (v2.7.4) for my environment (I'm on Ubuntu 16.04 which is old). I will soon move to a new PC with a new Ubuntu version.
In the build guidelines for the Android App there is: ANDROID_ABI=arm64-v8a ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle ./build-commissioner-libs.sh
I'm confused about what I should put instead of $HOME/Library/Android/sdk/ndk-bundle.
I have installed "NDK (Side by side)" as indicated on https://developer.android.com/studio/projects/install-ndk In my SDK directory, I now have a ndk directory containing another directory called "22.1.7171670". I'm wondering where should be the ndk-bundle directory.
Thanks