googlesamples/android-vulkan-tutorials

How to use dlopen() on Android 8?

RPG3D opened this issue · 6 comments

RPG3D commented

In my test ndk app, dlopen() reutrn nullptr.

Java_com_github_rpg3d_sword2android_MainActivity_runGame(JNIEnv* env, jobject /* this */)
{

    void* handle = dlopen("libvulkan.so", RTLD_NOW|RTLD_LOCAL);
    char* loaderror = (char *) dlerror();
    Game game;
    game.run();

}
ggfan commented

that should be the way. Is Vulkan supported on the device?

RPG3D commented

that should be the way. Is Vulkan supported on the device?

yes. my device can run your LoadVulkan sample, but not my own test app

ggfan commented

I am not sure what the problem is. you are also using native-activity? ( not sure that matters at all)

Re-run the app while keep "adb logcat" running on command line, see if you could have some clue from there ( adb logcat ): it normally throw error message ( but buried in million of other non-related messages ) :-(

RPG3D commented

In single module it runs well. but in multi module app didn't.
would you give me some help ? I am portting an old 2D PC game to Android, but failed...
https://github.com/RPG3D/Sword2

@RPG3D, try to use vulkan_wrapper.cpp instead of manually loading of Vulkan API functions

RPG3D commented

@RPG3D, try to use vulkan_wrapper.cpp instead of manually loading of Vulkan API functions

thanks, I will do some test