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

OT-COMMISSIONER Android Build Error #243

Open
Hariprabhu13 opened this issue Mar 27, 2024 · 9 comments · Fixed by #244
Open

OT-COMMISSIONER Android Build Error #243

Hariprabhu13 opened this issue Mar 27, 2024 · 9 comments · Fixed by #244

Comments

@Hariprabhu13
Copy link

Hi,

   I have clone the ot-commissioner repository in WSL . In that ot-commissioner cli tool is working , but the build for Android app in ot-commissioner is showing an error.

   1.) WSL ubuntu Version  :  Ubuntu 22.04.3 LTS
   2.) Android Studio Version  :  Iguana | 2023.2.1

I have cloned the repository using this guide --> "https://openthread.io/guides/commissioner/build"

The ot-commissioner is working but running the android in the ot-commissioner creating error

Error Log :

root@LAPTOP-0IPM4116:/mnt/c/Commissioner/ot-commissioner/android# ../script/bootstrap.sh
OS is Linux
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.9ubuntu3).
libreadline-dev is already the newest version (8.1.2-1).
jsonlint is already the newest version (1.8.3-2).
lcov is already the newest version (1.15-1).
ninja-build is already the newest version (1.10.1-1).
swig is already the newest version (4.0.2-1ubuntu1).
cmake is already the newest version (3.22.1-1ubuntu1.22.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package clang-format-9
WARNING: could not install clang-format-9, which is useful if you plan to contribute C/C++ code to the OpenThread project.
Requirement already satisfied: yapf==0.29.0 in /usr/local/lib/python3.10/dist-packages (0.29.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
/mnt/c/Commissioner/ot-commissioner/android
root@LAPTOP-0IPM4116:/mnt/c/Commissioner/ot-commissioner/android# ANDROID_ABI=arm64-v8a ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle ./build-commissioner-libs.sh
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:30 (project):
The CMAKE_C_COMPILER:

/mnt/c/Users/hariprabhu/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:30 (project):
The CMAKE_CXX_COMPILER:

/mnt/c/Users/hariprabhu/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "/mnt/c/Commissioner/ot-commissioner/android/.build-arm64-v8a/CMakeFiles/CMakeOutput.log".
See also "/mnt/c/Commissioner/ot-commissioner/android/.build-arm64-v8a/CMakeFiles/CMakeError.log".
root@LAPTOP-0IPM4116:/mnt/c/Commissioner/ot-commissioner/android#

The followed Guide that have been given by the ot-commissioner , I have used,

1.) ../script/bootstrap.sh
2.) ANDROID_ABI=arm64-v8a ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle ./build-commissioner-libs.sh

Please suggest me to clear the cmake error to build the ot-commissioner app in WSL.

@wgtdkp
Copy link
Member

wgtdkp commented Mar 27, 2024

Do you have this file? /mnt/c/Users/hariprabhu/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang

wgtdkp added a commit to wgtdkp/ot-commissioner that referenced this issue Mar 27, 2024
@Hariprabhu13
Copy link
Author

Hi @wgtdkp ,

Thanks for your reply,

The path you have mentioned above from my side it is like,...

[ /mnt/c/Users/hariprabhu/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin ]

In the bin folder it is containing no. of clang and clang++ files...

        root@LAPTOP-0IPM4116:/mnt/c/Users/hariprabhu/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin# ls
        aarch64-linux-android-addr2line.exe     armv7a-linux-androideabi23-clang++.cmd  i686-linux-android29-clang++
        aarch64-linux-android-ar.exe            armv7a-linux-androideabi23-clang.cmd    i686-linux-android29-clang++.cmd
        aarch64-linux-android-as.exe            armv7a-linux-androideabi24-clang        i686-linux-android29-clang.cmd
        aarch64-linux-android-c++filt.exe       armv7a-linux-androideabi24-clang++      i686-linux-android30-clang
        aarch64-linux-android-dwp.exe           armv7a-linux-androideabi24-clang++.cmd  i686-linux-android30-clang++
        aarch64-linux-android-elfedit.exe       armv7a-linux-androideabi24-clang.cmd    i686-linux-android30-clang++.cmd
        aarch64-linux-android-gprof.exe         armv7a-linux-androideabi26-clang        i686-linux-android30-clang.cmd
        aarch64-linux-android-ld.bfd.exe        armv7a-linux-androideabi26-clang++      ld.exe
        aarch64-linux-android-ld.gold.exe       armv7a-linux-androideabi26-clang++.cmd  ld.lld.exe
        aarch64-linux-android-nm.exe            armv7a-linux-androideabi26-clang.cmd    liblldb.dll
        aarch64-linux-android-objcopy.exe       armv7a-linux-androideabi27-clang        libwinpthread-1.dll
        aarch64-linux-android-objdump.exe       armv7a-linux-androideabi27-clang++      libxml2.dll
        aarch64-linux-android-ranlib.exe        armv7a-linux-androideabi27-clang++.cmd  lldb-argdumper.exe
        aarch64-linux-android-readelf.exe       armv7a-linux-androideabi27-clang.cmd    lldb.cmd
        aarch64-linux-android-size.exe          armv7a-linux-androideabi28-clang        lldb.exe
        aarch64-linux-android-strings.exe       armv7a-linux-androideabi28-clang++      llvm-addr2line.exe
        aarch64-linux-android-strip.exe         armv7a-linux-androideabi28-clang++.cmd  llvm-ar.exe
        aarch64-linux-android21-clang           armv7a-linux-androideabi28-clang.cmd    llvm-as.exe
        aarch64-linux-android21-clang++         armv7a-linux-androideabi29-clang        llvm-cfi-verify.exe
        aarch64-linux-android21-clang++.cmd     armv7a-linux-androideabi29-clang++      llvm-config.exe
        aarch64-linux-android21-clang.cmd       armv7a-linux-androideabi29-clang++.cmd  llvm-cov.exe
        aarch64-linux-android22-clang           armv7a-linux-androideabi29-clang.cmd    llvm-dis.exe
        aarch64-linux-android22-clang++         armv7a-linux-androideabi30-clang        llvm-dwarfdump.exe
        aarch64-linux-android22-clang++.cmd     armv7a-linux-androideabi30-clang++      llvm-lib.exe
        aarch64-linux-android22-clang.cmd       armv7a-linux-androideabi30-clang++.cmd  llvm-link.exe
        aarch64-linux-android23-clang           armv7a-linux-androideabi30-clang.cmd    llvm-modextract.exe
        aarch64-linux-android23-clang++         clang++.exe                             llvm-nm.exe
        aarch64-linux-android23-clang++.cmd     clang-check.exe                         llvm-objcopy.exe
        aarch64-linux-android23-clang.cmd       clang-cl.exe                            llvm-objdump.exe
        aarch64-linux-android24-clang           clang-format.exe                        llvm-profdata.exe
        aarch64-linux-android24-clang++         clang-tidy.exe                          llvm-ranlib.exe
        aarch64-linux-android24-clang++.cmd     clang.exe                               llvm-rc.exe
        aarch64-linux-android24-clang.cmd       dsymutil.exe                            llvm-readelf.exe
        aarch64-linux-android26-clang           git-clang-format                        llvm-readobj.exe
        aarch64-linux-android26-clang++         i686-linux-android-addr2line.exe        llvm-size.exe
        aarch64-linux-android26-clang++.cmd     i686-linux-android-ar.exe               llvm-strings.exe
        aarch64-linux-android26-clang.cmd       i686-linux-android-as.exe               llvm-strip.exe
        aarch64-linux-android27-clang           i686-linux-android-c++filt.exe          llvm-symbolizer.exe
        aarch64-linux-android27-clang++         i686-linux-android-dwp.exe              python38.dll
        aarch64-linux-android27-clang++.cmd     i686-linux-android-elfedit.exe          sancov.exe
        aarch64-linux-android27-clang.cmd       i686-linux-android-gprof.exe            sanstats.exe
        aarch64-linux-android28-clang           i686-linux-android-ld.bfd.exe           x86_64-linux-android-addr2line.exe
        aarch64-linux-android28-clang++         i686-linux-android-ld.gold.exe          x86_64-linux-android-ar.exe
        aarch64-linux-android28-clang++.cmd     i686-linux-android-nm.exe               x86_64-linux-android-as.exe
        aarch64-linux-android28-clang.cmd       i686-linux-android-objcopy.exe          x86_64-linux-android-c++filt.exe
        aarch64-linux-android29-clang           i686-linux-android-objdump.exe          x86_64-linux-android-dwp.exe
        aarch64-linux-android29-clang++         i686-linux-android-ranlib.exe           x86_64-linux-android-elfedit.exe
        aarch64-linux-android29-clang++.cmd     i686-linux-android-readelf.exe          x86_64-linux-android-gprof.exe
        aarch64-linux-android29-clang.cmd       i686-linux-android-size.exe             x86_64-linux-android-ld.bfd.exe
        aarch64-linux-android30-clang           i686-linux-android-strings.exe          x86_64-linux-android-ld.gold.exe
        aarch64-linux-android30-clang++         i686-linux-android-strip.exe            x86_64-linux-android-nm.exe
        aarch64-linux-android30-clang++.cmd     i686-linux-android16-clang              x86_64-linux-android-objcopy.exe
        aarch64-linux-android30-clang.cmd       i686-linux-android16-clang++            x86_64-linux-android-objdump.exe
        arm-linux-androideabi-addr2line.exe     i686-linux-android16-clang++.cmd        x86_64-linux-android-ranlib.exe
        arm-linux-androideabi-ar.exe            i686-linux-android16-clang.cmd          x86_64-linux-android-readelf.exe
        arm-linux-androideabi-as.exe            i686-linux-android17-clang              x86_64-linux-android-size.exe
        arm-linux-androideabi-c++filt.exe       i686-linux-android17-clang++            x86_64-linux-android-strings.exe
        arm-linux-androideabi-dwp.exe           i686-linux-android17-clang++.cmd        x86_64-linux-android-strip.exe
        arm-linux-androideabi-elfedit.exe       i686-linux-android17-clang.cmd          x86_64-linux-android21-clang
        arm-linux-androideabi-gprof.exe         i686-linux-android18-clang              x86_64-linux-android21-clang++
        arm-linux-androideabi-ld.bfd.exe        i686-linux-android18-clang++            x86_64-linux-android21-clang++.cmd
        arm-linux-androideabi-ld.gold.exe       i686-linux-android18-clang++.cmd        x86_64-linux-android21-clang.cmd
        arm-linux-androideabi-nm.exe            i686-linux-android18-clang.cmd          x86_64-linux-android22-clang
        arm-linux-androideabi-objcopy.exe       i686-linux-android19-clang              x86_64-linux-android22-clang++
        arm-linux-androideabi-objdump.exe       i686-linux-android19-clang++            x86_64-linux-android22-clang++.cmd
        arm-linux-androideabi-ranlib.exe        i686-linux-android19-clang++.cmd        x86_64-linux-android22-clang.cmd
        arm-linux-androideabi-readelf.exe       i686-linux-android19-clang.cmd          x86_64-linux-android23-clang
        arm-linux-androideabi-size.exe          i686-linux-android21-clang              x86_64-linux-android23-clang++
        arm-linux-androideabi-strings.exe       i686-linux-android21-clang++            x86_64-linux-android23-clang++.cmd
        arm-linux-androideabi-strip.exe         i686-linux-android21-clang++.cmd        x86_64-linux-android23-clang.cmd
        armv7a-linux-androideabi16-clang        i686-linux-android21-clang.cmd          x86_64-linux-android24-clang
        armv7a-linux-androideabi16-clang++      i686-linux-android22-clang              x86_64-linux-android24-clang++
        armv7a-linux-androideabi16-clang++.cmd  i686-linux-android22-clang++            x86_64-linux-android24-clang++.cmd
        armv7a-linux-androideabi16-clang.cmd    i686-linux-android22-clang++.cmd        x86_64-linux-android24-clang.cmd
        armv7a-linux-androideabi17-clang        i686-linux-android22-clang.cmd          x86_64-linux-android26-clang
        armv7a-linux-androideabi17-clang++      i686-linux-android23-clang              x86_64-linux-android26-clang++
        armv7a-linux-androideabi17-clang++.cmd  i686-linux-android23-clang++            x86_64-linux-android26-clang++.cmd
        armv7a-linux-androideabi17-clang.cmd    i686-linux-android23-clang++.cmd        x86_64-linux-android26-clang.cmd
        armv7a-linux-androideabi18-clang        i686-linux-android23-clang.cmd          x86_64-linux-android27-clang
        armv7a-linux-androideabi18-clang++      i686-linux-android24-clang              x86_64-linux-android27-clang++
        armv7a-linux-androideabi18-clang++.cmd  i686-linux-android24-clang++            x86_64-linux-android27-clang++.cmd
        armv7a-linux-androideabi18-clang.cmd    i686-linux-android24-clang++.cmd        x86_64-linux-android27-clang.cmd
        armv7a-linux-androideabi19-clang        i686-linux-android24-clang.cmd          x86_64-linux-android28-clang
        armv7a-linux-androideabi19-clang++      i686-linux-android26-clang              x86_64-linux-android28-clang++
        armv7a-linux-androideabi19-clang++.cmd  i686-linux-android26-clang++            x86_64-linux-android28-clang++.cmd
        armv7a-linux-androideabi19-clang.cmd    i686-linux-android26-clang++.cmd        x86_64-linux-android28-clang.cmd
        armv7a-linux-androideabi21-clang        i686-linux-android26-clang.cmd          x86_64-linux-android29-clang
        armv7a-linux-androideabi21-clang++      i686-linux-android27-clang              x86_64-linux-android29-clang++
        armv7a-linux-androideabi21-clang++.cmd  i686-linux-android27-clang++            x86_64-linux-android29-clang++.cmd
        armv7a-linux-androideabi21-clang.cmd    i686-linux-android27-clang++.cmd        x86_64-linux-android29-clang.cmd
        armv7a-linux-androideabi22-clang        i686-linux-android27-clang.cmd          x86_64-linux-android30-clang
        armv7a-linux-androideabi22-clang++      i686-linux-android28-clang              x86_64-linux-android30-clang++
        armv7a-linux-androideabi22-clang++.cmd  i686-linux-android28-clang++            x86_64-linux-android30-clang++.cmd
        armv7a-linux-androideabi22-clang.cmd    i686-linux-android28-clang++.cmd        x86_64-linux-android30-clang.cmd
        armv7a-linux-androideabi23-clang        i686-linux-android28-clang.cmd          yasm.exe
        armv7a-linux-androideabi23-clang++      i686-linux-android29-clang

It shows the number of Clang and Clang++ in the folder.

@wgtdkp
Copy link
Member

wgtdkp commented Mar 27, 2024

It shows that the compilers are under a windows directory: /mnt/c/Users/hariprabhu/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin. I guess you are developing on Windows and want to build the ot-commissioner library in a ubuntu docker installed on this windows. So you mapped the Android NDK from the windows NDK to into the ubuntu container, is it? I think you need to download a linux version NDK in ubuntu

wgtdkp added a commit to wgtdkp/ot-commissioner that referenced this issue Mar 27, 2024
@Hariprabhu13
Copy link
Author

Thanks @wgtdkp ,
In running the ot-commissioner library in Windows Sub-System Linux(WSL). But, the OT-COMMISSIONER CLI properly work in my WSL system it is in the same repository. I have set the "pskc" from the ot-commissioner and start OTBR commissioner externally. There is no issue in that. But I have Build the script of android in the same repository it producing the Cmake errors.

@wgtdkp
Copy link
Member

wgtdkp commented Mar 28, 2024

Yeah, the ot-commissioner Android build process currently doesn't support Windows, I am looking into how I can support windows now.

I will keep this issue updated when there are progress

@Hariprabhu13
Copy link
Author

Thank you @wgtdkp ,
I am waiting for your Update...

wgtdkp added a commit to wgtdkp/ot-commissioner that referenced this issue Mar 29, 2024
wgtdkp added a commit to wgtdkp/ot-commissioner that referenced this issue Mar 29, 2024
wgtdkp added a commit to wgtdkp/ot-commissioner that referenced this issue Mar 29, 2024
@wgtdkp
Copy link
Member

wgtdkp commented Mar 30, 2024

@jwhui the issue here is about building on windows, the grade version update doesn’t resolve it. I am reopening this one

@wgtdkp wgtdkp reopened this Mar 30, 2024
@jwhui
Copy link
Member

jwhui commented Mar 30, 2024

@jwhui the issue here is about building on windows, the grade version update doesn’t resolve it. I am reopening this one

@wgtdkp , this was auto-closed by #244, where you had included the following in the PR description:

Fixes issue: #243

@wgtdkp
Copy link
Member

wgtdkp commented Mar 30, 2024

Oh sorry, I don’t know it’s going to auto close the issue 😅

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

Successfully merging a pull request may close this issue.

3 participants