I’m working on a plugin for android and want to access the FJavaWrapper class from my code.
So I inlcude
#include "Android/AndroidJNI.h"
to my cpp file. In the normal compile setting “Development Editor/Win64” all is fine couse the plugin is whitelisted for Android.
But if I try to launch on Android, my plugin is compiled for android again and I got a
fatal error: 'Android/AndroidJNI.h' file not found
And it drives me crazy. I saw the GearVR PlugIn uses the file too, and it looks like that it works. I take a look in there plugin build settings and saw nothing which points to the AndroidJNI.h, or added it to the include dependencies.
What should I do to use the AndroidJNI in specially the FJavaWrapper in my Plugin?
I had to add “/Source/Runtime/Launch/Private” in the private include section of my plugin c# config file. Each source project/plugin has one. But I worked on a plugin which worked on the engine source base and not a precompiled engine from the Epic Game Laucher.
in the XXX.uplugin file add WhitelistPlatforms": [ “Android”, “Win64” ] to Modules
in the cpp file, add following including files. #if PLATFORM_ANDROID #include “AndroidPlatform.h” #include “Android/AndroidApplication.h” #include “Android/AndroidJNI.h” #include “Android/AndroidJava.h” #endif
in the c++ code, use PLATFORM_ANDROID MACRO to distinguish the java code and C++ platform code
Hello. I have the same issue and i didn’t understand your solution. Can you share exactly the include field. I tried include “Android/AndroidJNI.h/Source/Runtime/Launch/Private” but it was wrong