Error while building DCMTK lib for ANDROID

Compilation and installation of DCMTK

Moderator: Moderator Team

Message
Author
ashajg
Posts: 30
Joined: Thu, 2018-10-11, 11:10

Error while building DCMTK lib for ANDROID

#1 Post by ashajg »

Hi guys

I am trying to generate DCMTK lib for ANDROID platform.
I used CMAKE 3.12.1 to configure DCMTK but getting some issue

ERROR MESSAGE:

CMake Error at CMake/dcmtkUseAndroidSDK.cmake:301 (MESSAGE):
Please select which Android emulator Android Virtual Device (AVD) configuration to use!
Call Stack (most recent call first): CMake/dcmtkPrepare.cmake:179 (DCMTK_ANDROID_START_EMULATOR)
CMakeLists.txt:17 (INCLUDE)

I am not able to see any Android emulator AVD in drop down list.

Please help!

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Error while building DCMTK lib for ANDROID

#2 Post by Jan Schlamelcher »

What version of DCMTK are you using?
Did you create an AVD and it is not listed, or did you simply not create one?

ashajg
Posts: 30
Joined: Thu, 2018-10-11, 11:10

Re: Error while building DCMTK lib for ANDROID

#3 Post by ashajg »

Hi sir

I am using DCMTK 3.6.3 and created AVD in android studio but it is not listed in CMAKE GUI.

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Error while building DCMTK lib for ANDROID

#4 Post by Jan Schlamelcher »

I see, well, DCMTK uses the following code to create the list for that combobox:

Code: Select all

execute_process(COMMAND "${ANDROID_ANDROID_PROGRAM}" list avd RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_QUIET)
string(REGEX MATCHALL "Name:[ \t]*[^\r\n]*" ANDROID_AVAILABLE_AVDS ${OUTPUT})
string(REGEX REPLACE "Name:[ \t]*([^\r\n;]*)" "\\1" ANDROID_AVAILABLE_AVDS "${ANDROID_AVAILABLE_AVDS}")
set(ANDROID_EMULATOR_AVD "${ANDROID_EMULATOR_AVD}" CACHE STRING "Android emulator Android Virtual Device (AVD) configuration" FORCE)
set_property(CACHE ANDROID_EMULATOR_AVD PROPERTY STRINGS ${ANDROID_AVAILABLE_AVDS})
Can you try running android list avd in a terminal to see what happens?

ashajg
Posts: 30
Joined: Thu, 2018-10-11, 11:10

Re: Error while building DCMTK lib for ANDROID

#5 Post by ashajg »

Hi sir

I am getting list of AVDs by passing command.
I tried same process on another PC and problem was solved.
Don't know why it is throwing error on my PC only.

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Error while building DCMTK lib for ANDROID

#6 Post by Jan Schlamelcher »

Strange, great you found a solution though. My only further Idea would be to look into CMakeError.log in the build directory if you want to try and find out why it fails on your PC.

ashajg
Posts: 30
Joined: Thu, 2018-10-11, 11:10

Re: Error while building DCMTK lib for ANDROID

#7 Post by ashajg »

Hi sir

Some days back I discussed this issue(cannot find avd in dropdown of cmake gui) and while executing same steps on another system it got solved.
I just want to ask if we can solve this problem by setting environment variables??

Thanks and Regards
Ashish

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Error while building DCMTK lib for ANDROID

#8 Post by Jan Schlamelcher »

That might have an effect, but this would be about the Android toolchain and not DCMTK itself. Google keeps changing how that works from version to version, it's a bit hard to stay up to date.

ashajg
Posts: 30
Joined: Thu, 2018-10-11, 11:10

Re: Error while building DCMTK lib for ANDROID

#9 Post by ashajg »

Ok...

Can you suggest me some way I may try..

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Error while building DCMTK lib for ANDROID

#10 Post by Jan Schlamelcher »

Another idea: you could post your output of android list avd so that I can check whether they changed that enough for our parser to no longer understand it.

ashajg
Posts: 30
Joined: Thu, 2018-10-11, 11:10

Re: Error while building DCMTK lib for ANDROID

#11 Post by ashajg »

Hi sir

Sorry for my late response.

After putting android list avd in command prompt i am getting following result:

C:\Users\user>android list avd
**************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools\bin\sdkmanager.bat
and tools\bin\avdmanager.bat
**************************************************************************

Invoking "C:\Users\user\AppData\Local\Android\Sdk\tools\bin\avdmanager" list avd



ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

Thanks and Regards
Ashish

ashajg
Posts: 30
Joined: Thu, 2018-10-11, 11:10

Re: Error while building DCMTK lib for ANDROID

#12 Post by ashajg »

after setting JAVA_HOME I got following result:

C:\Users\user>android list avd
**************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools\bin\sdkmanager.bat
and tools\bin\avdmanager.bat
**************************************************************************

Invoking "C:\Users\user\AppData\Local\Android\Sdk\tools\bin\avdmanager" list avd


Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annota
tion/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(Sc
hemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHa
ndler.java:81)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinCla
ssLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(C
lassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more

ashajg
Posts: 30
Joined: Thu, 2018-10-11, 11:10

Re: Error while building DCMTK lib for ANDROID

#13 Post by ashajg »

Hi sir

Solved that problem :D
Just used java 8 and now i am getting avds.

Thank you for the hint.

just want to know





After pressing configure button i got this

Looking for main in socket - not found
Looking for socket in socket
Looking for socket in socket - not found
Info: STL vector support disabled
Info: STL algorithm support disabled
Info: STL limits support disabled
Info: STL list support disabled
Info: STL map support disabled
Info: STL memory support disabled
Info: STL stack support disabled
Info: STL string support disabled
Info: STL type_traits support disabled
Info: STL tuple support disabled
Info: STL system_error support disabled
CMake Error at CMake/GenerateDCMTKConfigure.cmake:1269 (message):
/system/bin/sh: /cache/arith.cc: not executable: 32-bit ELF file

Call Stack (most recent call first):
CMakeLists.txt:53 (INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES)

please give me hint how i can proceed further..

Thanks and Regards
Ashish

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Error while building DCMTK lib for ANDROID

#14 Post by Jan Schlamelcher »

Well, it seems to me that CMake tries to execute the code locally whereas it should execute in on the emulator.

EDIT: I also added this to our bugtracker regarding the deprecation warning: https://support.dcmtk.org/redmine/issues/851

ashajg
Posts: 30
Joined: Thu, 2018-10-11, 11:10

Re: Error while building DCMTK lib for ANDROID

#15 Post by ashajg »

Ok.

So for this issue what i can try?

CMake Error at CMake/GenerateDCMTKConfigure.cmake:1269 (message):
/system/bin/sh: /cache/arith.cc: not executable: 32-bit ELF file

Call Stack (most recent call first):
CMakeLists.txt:53 (INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES)


CMAKE is showing that ANDROID_STL_SHARED_OBJECT-NOT FOUND

secondly problem with 32-bit ELF file

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest