Android Vulkan — NDK Update
Will update the content if new versions come out.
I update NDK version to r18 for a new feature
VK_KHR_multiview. And some changes are applied to
layerlib/CMakeLists.txt due to updates of
Vulkan layers and STL backend for Android Studio.
I found NDK r17 is pretty much the same with that in r18 in Vulkan layer files so I group command blocks with r17 as a baseline. NDK version is referenced by the variable
I don’t want any duplicated compiling flags so I back up the original CPP flags of each
CMAKE_CXX_clone which is used to restore the CPP flags at the end. Then I separate macro symbols from
CMAKE_CXX_FLAGS in order for definitions to be in effect after CPP flags are restored.
The remaining functionality in the VK_LAYER_LUNARG_swapchain layer has been migrated into the VK_LAYER_LUNARG_core_validation layer
Disappeared after Vulkan 18.104.22.168, not even mentioned in changelog.
Layers Source Files
Source files for building layer libraries are different between versions, check
layerlib/CMakeLists.txt in detail.
LLVM’s libc++ is the C++ standard library that has been used by the Android OS since Lollipop, and as of NDK r18 is the only STL available in the NDK.
If all of your application's native code is contained in a single shared library, we recommend using the static…developer.android.com
We might get a message like saying
WARNING: ABIs [armeabi-v7a,armeabi] set by ‘android.injected.build.abi’ gradle flag contained ‘ARMEABI’ not targeted by this project
while building the project. It happened when I upgraded NDK version to r18 and I found no solutions about this problem(it’s just a warning, our app still works).
And we might need to delete
cmake folder in
\.externalNativeBuild in order to avoid the error stating that linker cannot find
libc++.so. The name of STL libraries began to have version postfix like
libc++.so.22, etc, from r18, which indicates Android platform version.