# VTK8.2.0(& VTK 9.1.0) for android with official Android's example(JavaVTK) not runing exactly

**URL:** https://discourse.vtk.org/t/vtk8-2-0-vtk-9-1-0-for-android-with-official-androids-example-javavtk-not-runing-exactly/7622
**Category:** Support
**Created:** [January 12, 2022, 9:03am UTC](https://discourse.vtk.org/t/vtk8-2-0-vtk-9-1-0-for-android-with-official-androids-example-javavtk-not-runing-exactly/7622 "2022-01-12T09:03:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![user\_1](https://discourse.vtk.org/user_avatar/discourse.vtk.org/user_1/32/7409_2.png) [@user\_1](https://discourse.vtk.org/u/user_1)
#### Post date: [January 12, 2022, 9:03am UTC](https://discourse.vtk.org/t/vtk8-2-0-vtk-9-1-0-for-android-with-official-androids-example-javavtk-not-runing-exactly/7622/1 "2022-01-12T09:03:21Z")

</div>

Hello everyone,  
I was already build VTK 8.2.0 and VTK 9.1.0 with ndk-r21e and import it into AndroidStudio.  
I was created 2 projects that one include VTK-8.2.0 and the other include VTK-9.1.0 , and I copy the code which from github(Java and c++ source code) into the AndroidStudio.  
in project \<VTK 8.2.0\> ,it was crashed immediately, I found it is because vtkRenderWindow::New() return Null!  
in project \<VTK 9.1.0\>, it was not crash,but only black screen!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [January 12, 2022, 9:11am UTC](https://discourse.vtk.org/t/vtk8-2-0-vtk-9-1-0-for-android-with-official-androids-example-javavtk-not-runing-exactly/7622/2 "2022-01-12T09:11:09Z")

</div>

We recently fixed some stuff in android, you may want to try with master.

---

<div class="post-metadata">

### Author: ![user\_1](https://discourse.vtk.org/user_avatar/discourse.vtk.org/user_1/32/7409_2.png) [@user\_1](https://discourse.vtk.org/u/user_1)
#### Post date: [January 12, 2022, 9:16am UTC](https://discourse.vtk.org/t/vtk8-2-0-vtk-9-1-0-for-android-with-official-androids-example-javavtk-not-runing-exactly/7622/3 "2022-01-12T09:16:28Z")

</div>

thanks for your reply, I will try it later

---

<div class="post-metadata">

### Author: ![user\_1](https://discourse.vtk.org/user_avatar/discourse.vtk.org/user_1/32/7409_2.png) [@user\_1](https://discourse.vtk.org/u/user_1)
#### Post date: [January 12, 2022, 10:06am UTC](https://discourse.vtk.org/t/vtk8-2-0-vtk-9-1-0-for-android-with-official-androids-example-javavtk-not-runing-exactly/7622/4 "2022-01-12T10:06:36Z")

</div>

I have rebuild with master and import into AndroidStudio,but it is still the same problem! 😔

---

<div class="post-metadata">

### Author: ![user\_1](https://discourse.vtk.org/user_avatar/discourse.vtk.org/user_1/32/7409_2.png) [@user\_1](https://discourse.vtk.org/u/user_1)
#### Post date: [January 12, 2022, 10:13am UTC](https://discourse.vtk.org/t/vtk8-2-0-vtk-9-1-0-for-android-with-official-androids-example-javavtk-not-runing-exactly/7622/5 "2022-01-12T10:13:19Z")

</div>

my build.sh :

#!/bin/bash  
cmake …   
-DVTK\_ANDROID\_BUILD=ON   
-DANDROID\_NDK=$ANDROID\_NDK   
-DANDROID\_NATIVE\_API\_LEVEL=21   
-DANDROID\_ARCH\_ABI=arm64-v8a   
-DCMAKE\_TOOLCHAIN\_FILE=$ANDROID\_NDK/build/cmake/android.toolchain.cmake   
-DCMAKE\_SYSTEM\_NAME=Android   
-DCMAKE\_BUILD\_TYPE=Release

make clean

make -j6

am I missing any build options for android?

---

<div class="post-metadata">

### Author: ![perphy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/958977/32.png) [@perphy](https://discourse.vtk.org/u/perphy)
#### Post date: [December 7, 2022, 4:54pm UTC](https://discourse.vtk.org/t/vtk8-2-0-vtk-9-1-0-for-android-with-official-androids-example-javavtk-not-runing-exactly/7622/6 "2022-12-07T16:54:34Z")

</div>

I recently build vtk9.2.2 with ndk25.  
I try to run the official example nativevtk on android studio on windows, but get black screen as well.  
Do you fix the problem now?  
Thanks

---

<div class="post-metadata">

### Author: ![perphy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/958977/32.png) [@perphy](https://discourse.vtk.org/u/perphy)
#### Post date: [December 8, 2022, 3:34am UTC](https://discourse.vtk.org/t/vtk8-2-0-vtk-9-1-0-for-android-with-official-androids-example-javavtk-not-runing-exactly/7622/7 "2022-12-08T03:34:57Z")

</div>

Hi, Mathieu:

VTK8.2 and 9.2.2 could work properly on android now?  
I meet the same problem.  
Thanks very much!
