# JavaVTK Example Android Black Screen

**URL:** <https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730>\
**Category:** Support\
**Created:** [April 17, 2024, 3:28pm UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730 "2024-04-17T15:28:00Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Don\_Zenk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/don_zenk/32/8710_2.png) [@Don\_Zenk](https://discourse.vtk.org/u/Don_Zenk)\
**Post date:** [April 17, 2024, 3:28pm UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/1 "2024-04-17T15:28:00Z")

</div>

Hi,

I tested the JavaVTK example with 8.2 and it works as expected while I got black screen with 9.3 and also with the latest master. VTK was build with the NDK version 25.1.8937393, ABI arm64-v8a, API 27, toolchain 25.1.8937393/build/cmake/android.toolchain.cmake and the compiler 25.1.8937393/toolchains/llvm/prebuilt/darwin-x86\_64/bin/clang++. Am I doing something wrong? As I said, it works with 8.2.

Best,  
Don

---

<div class="post-metadata">

**Author:** ![jiajiadelequ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiajiadelequ/32/8738_2.png) [@jiajiadelequ](https://discourse.vtk.org/u/jiajiadelequ)\
**Post date:** [April 18, 2024, 3:29am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/2 "2024-04-18T03:29:03Z")

</div>

Hey friend, you and I have encountered the same problem. When running and entering the program, there will be a black screen, but the project can only be rendered normally after touching the screen.  
I hope the official can help us

---

<div class="post-metadata">

**Author:** ![jiajiadelequ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiajiadelequ/32/8738_2.png) [@jiajiadelequ](https://discourse.vtk.org/u/jiajiadelequ)\
**Post date:** [April 18, 2024, 3:37am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/3 "2024-04-18T03:37:46Z")

</div>

I have relevant videos here to demonstrate this bug

[![](https://discourse.vtk.org/uploads/default/original/2X/6/62e3697424167c62da330b5165644f688485fd14.jpeg "Screenrecorder 2024 04 18 11 30 49 340") ](https://www.youtube.com/watch?v=HSFQOLuL4S0)

---

<div class="post-metadata">

**Author:** ![simand](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@simand](https://discourse.vtk.org/u/simand)\
**Post date:** [April 18, 2024, 7:08am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/4 "2024-04-18T07:08:52Z")

</div>

I can also confirm experiencing a black screen when testing the JavaVTK example with version 9.3.

---

<div class="post-metadata">

**Author:** ![Don\_Zenk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/don_zenk/32/8710_2.png) [@Don\_Zenk](https://discourse.vtk.org/u/Don_Zenk)\
**Post date:** [April 18, 2024, 7:17am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/5 "2024-04-18T07:17:47Z")

</div>

Hi Lancer,

I was not even able to get rid of the black screen after the interaction. How did you build VTK 9.3 (NDK, ABI, API, Compiler,…)?

Regards,  
Don

---

<div class="post-metadata">

**Author:** ![jiajiadelequ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiajiadelequ/32/8738_2.png) [@jiajiadelequ](https://discourse.vtk.org/u/jiajiadelequ)\
**Post date:** [April 18, 2024, 11:52am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/7 "2024-04-18T11:52:07Z")

</div>

Friend, I’ll tell you the detailed configuration tomorrow

---

<div class="post-metadata">

**Author:** ![jiajiadelequ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiajiadelequ/32/8738_2.png) [@jiajiadelequ](https://discourse.vtk.org/u/jiajiadelequ)\
**Post date:** [April 19, 2024, 5:27am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/8 "2024-04-19T05:27:22Z")

</div>

VTK compilation Module:  
System : Ubuntu20.04 (you can use the [VMware Workstation Pro])  
CMake : 3.27.6-linux-x86\_64 (use ninja generator compiler)  
VTK CMake : VTK\_ANDROID\_BUILD[√] VTK\_OPENGL\_USE\_GLES[√]  
NDK : r21e  
ABI : armeabi-v7a

VTK integration Module:  
IDE:Android Studio : 2022.3.1 Patch 2  
JDK : 17  
NDK : r21e  
CMake:3.22.1  
Gradle Plugin : 8.1.2  
Gradle : 8.0

---

<div class="post-metadata">

**Author:** ![Don\_Zenk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/don_zenk/32/8710_2.png) [@Don\_Zenk](https://discourse.vtk.org/u/Don_Zenk)\
**Post date:** [April 19, 2024, 7:52am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/10 "2024-04-19T07:52:56Z")

</div>

Thank you for the info. I tried with the following configuration, but were not able to get rid of black screen after the interaction:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/d/db7122eb9ef83b9ac91e66381f2ed928f454bffd.jpeg)

Did you try with arm64-v8a, since armeabi-v7a is an old 32-bit arhitecture?

As I have already said, 8.2 is working.

---

<div class="post-metadata">

**Author:** ![jiajiadelequ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiajiadelequ/32/8738_2.png) [@jiajiadelequ](https://discourse.vtk.org/u/jiajiadelequ)\
**Post date:** [April 19, 2024, 8:36am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/11 "2024-04-19T08:36:27Z")

</div>

The version of VTK I am using is 9.3.0.rc1  
And I have tried the vtk compilation of arm64-v8a version and it has been successful

 ![image](https://discourse.vtk.org/uploads/default/original/2X/5/51b6c2ae3d4909c4a7a76ff24e35128f75b5a532.png)

 ![image](https://discourse.vtk.org/uploads/default/original/2X/a/aa877294432737b74206f1e7829b706dad68f347.png)

Before compiling vtk9.3, you may need to make some configurations in the Ubuntu system, including environment variables, installation of the g++compiler, etc. I basically send error messages to ChatGPT or Google to search for answers. By the way, what are the compilation configurations used for your vtk8.2 and the Android studio version NDK version used for publishing, etc…

---

<div class="post-metadata">

**Author:** ![Don\_Zenk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/don_zenk/32/8710_2.png) [@Don\_Zenk](https://discourse.vtk.org/u/Don_Zenk)\
**Post date:** [April 19, 2024, 8:44am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/12 "2024-04-19T08:44:47Z")

</div>

I built 8.2 with the same configuration as I posted for 9.3.

Android build configurator:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/5/53b792936b00f6b5d72759148ec59b9d3457d5b2.png)

---

<div class="post-metadata">

**Author:** ![jiajiadelequ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiajiadelequ/32/8738_2.png) [@jiajiadelequ](https://discourse.vtk.org/u/jiajiadelequ)\
**Post date:** [April 19, 2024, 8:49am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/13 "2024-04-19T08:49:07Z")

</div>

Hi brother, I think we can add a contact information and study this together

---

<div class="post-metadata">

**Author:** ![Don\_Zenk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/don_zenk/32/8710_2.png) [@Don\_Zenk](https://discourse.vtk.org/u/Don_Zenk)\
**Post date:** [April 19, 2024, 8:53am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/14 "2024-04-19T08:53:19Z")

</div>

Yet, I wrote you a private message.

---

<div class="post-metadata">

**Author:** ![jiajiadelequ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiajiadelequ/32/8738_2.png) [@jiajiadelequ](https://discourse.vtk.org/u/jiajiadelequ)\
**Post date:** [July 18, 2024, 6:51am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/15 "2024-07-18T06:51:43Z")

</div>

Friend, have you finally solved your problem?

---

<div class="post-metadata">

**Author:** ![jiajiadelequ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiajiadelequ/32/8738_2.png) [@jiajiadelequ](https://discourse.vtk.org/u/jiajiadelequ)\
**Post date:** [July 18, 2024, 6:55am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/16 "2024-07-18T06:55:04Z")

</div>

Friend, although I can run the dynamic library of VTK9.3 normally, the final generated APK package file will be very large. In contrast, the static library of VTK9.3 cannot run at all. I guess it may be due to the official static library link not being done properly here. I hope the official can reconsider

---

<div class="post-metadata">

**Author:** ![jiajiadelequ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiajiadelequ/32/8738_2.png) [@jiajiadelequ](https://discourse.vtk.org/u/jiajiadelequ)\
**Post date:** [July 24, 2024, 9:17am UTC](https://discourse.vtk.org/t/javavtk-example-android-black-screen/13730/17 "2024-07-24T09:17:56Z")

</div>

@mwestphal
