Issues running CMake generation for android toolchain

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
s.boman
Posts: 1
Joined: Mon, 2023-08-21, 08:05

Issues running CMake generation for android toolchain

#1 Post by s.boman »

Hi!

I have been trying to cross-compile DCMTK 3.6.7 for Android on a Windows 11 PC. I am using the latest version of Android Studio and very recent versions of the Android SDK and Android NDK. I get to the point where I select the AVD, meaning that the emulator at least can be called from the build system. The problem stopping me is the following error:

Code: Select all

ANDROID_PLATFORM not set. Defaulting to minimum supported version
16.
Starting the Android device emulator...
C:/Users/stefa/AppData/Local/Android/Sdk/tools/emulator.exe -avd DCMTK -no-boot-anim -prop ro.emu.uuid=5ee377ea19dde4164502df73fa8192c5 >C:/Temp/dcmtk-3.6.7/build_android/CMakeFiles/android-emulator.log 2>&1 < /dev/null &
CMake Error at CMake/dcmtkUseAndroidSDK.cmake:342 (message):
  Error starting Android emulator.
Call Stack (most recent call first):
  CMake/dcmtkPrepare.cmake:284 (DCMTK_ANDROID_START_EMULATOR)
  CMakeLists.txt:38 (include)
I used the bundled toolchain file: C:/Users/stefa/AppData/Local/Android/Sdk/ndk/21.3.6528147/build/cmake/android.toolchain.cmake
There where some indications that the DCMTK source came with a custom toolchain file but I could not find it. There are some git repositories with versions from about 8 years ago but that didn't seem right. I did test this one: https://github.com/pauldotknopf/DCMTK/b ... hain.cmake. It didn't even work running CMake Configure the first step.

Further more, the following versions are installed:
  • Windows 11 Pro Insider Preview 25931.1000
  • CMake 3.27.2
  • Minimal SYStem 1.0.11
  • Android Studio Giraffe 2022.3.1
    • SDK Platform: Android 13.0 ("Tiramisu") API Level 33
    • Android SDK Build-Tools 33.0.1
    • NDK (Side by side) 21.3.6528147
    • Android SDK Command-line Tools (latest) 11.0
I toggled Hyper-V between activated to disabled and back. Not expecting any difference.

I plan on trying some earlier versions and see if this helps. Also testing on a completely different computer just to rule out anything strange going on with this particular setup.

I have searched the forum and all other sources on internet. Nobody seem to have the exact same problem, so I am kind of stuck.
Thanks anyone in forehand helping me out.

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

Re: Issues running CMake generation for android toolchain

#2 Post by Marco Eichelberg »

This may sound trivial, but have you checked the content of android-emulator.log which should hopefully contain a meaningful error message?
If it doesn't, try removing the OUTPUT_QUIET and ERROR_QUIET flags in the execute_process() call in CMake/dcmtkUseAndroidSDK.cmake.

saltcreek
Posts: 2
Joined: Tue, 2023-12-12, 13:20

Re: Issues running CMake generation for android toolchain

#3 Post by saltcreek »

It is suspected that the path to MSYS is not specified in the PATH variable and sh.exe was not found.

Next problem will be that "-pro pro.emu.uuid=..." will be ignored.
UUID can be passed through "-prop qemu.uuid=...".
It is necessary to replace ro.emu.uuid with qemu.uuid in three places in the dcmtk/cmake/dcmtkUseAndroidSDK.cmake.

Android emulator version 32.1.11.0 (build_id 9536276) (CL:N/A)
Copyright (C) 2006-2017 The Android Open Source Project and many others.
This program is a derivative of the QEMU CPU emulator (www.qemu.org).
WARNING | unexpected '-prop' value ('ro.emu.uuid=...'), only 'qemu.*' properties are supported

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 1 guest