x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Error loading JNI.h and jni_md.h

I am working on a plugin that uses a 3rd party JAR to add functionality to android builds. I am using the AndroidJNI.h as a wrapper for my java class that interacts with the JAR file. Whenever I try to build my game the build fails at first because it couldn't find the JNI.h file that the AndroidJNI.h file needed. To fix this I added the path to it in the include directories for the game. Now it can't find the jni_md.h file which is one sub folder down from the JNI.h file. I added in the directory to this file as well but that didn't help. Has anyone else ran across this problem or have an idea on what I can do to fix it so that I can build my plugin? Any help would be greatly appreciated.

Product Version: UE 4.9
Tags:
more ▼

asked Mar 23 '16 at 07:54 PM in C++ Programming

avatar image

PsychoDiablo
6 1 3 3

avatar image MiKom Mar 23 '16 at 08:52 PM

On what build configuration does your build fail?

avatar image PsychoDiablo Mar 23 '16 at 09:07 PM

It fails in the development build and I haven't tried any others. I am trying to make my plugin accessible in blueprints as well.

avatar image MiKom Mar 23 '16 at 10:44 PM

So, your bult target platform is Win64?

avatar image PsychoDiablo Mar 24 '16 at 12:07 AM

Yes. Changing it to 32 it can't find the JNI.h but under the 64 it can't find jni_mh.h that is in the JNI.h file.

avatar image Shadowriver Mar 24 '16 at 12:31 AM

By "build the game" you mean when you build modules for editor build of engine or when you package the game that use your plugin?

avatar image PsychoDiablo Mar 24 '16 at 01:14 AM

When I try to launch the game via the Editor it can't build the plugin. So I open the C++ code and build solution and it fails there. I haven't tried to package because I can't get into the editor without disabling the plugin or removing the crucial part of my plugin.

avatar image Shadowriver Mar 24 '16 at 02:46 AM

Does your code and JNI stuff suppose to work on Windows?

avatar image PsychoDiablo Mar 24 '16 at 03:45 AM

Not exactly. The JNI part is for Android builds and will only be included in such, but the plugin needs to be blueprintable hence the windows part. It doesn't seem like it is any of the code I wrote that is causing the error. For whatever reason the AndoridJNI class that is part of the engine can't find the necessary JNI files to get compiled. I used the Android setup provided by Unreal to install the JDK, Android SDK and change the environment variables so all of that should be correct.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Currently, UE only adds JNI directories to header search directory when building for Android. Any code that touches JNI cannot be build for non-Android target.

You should either move all of this code to separate files, that aren't compiled in development editor builds or #ifdef all relevant includes and code under PLATFORM_ANDROID

more ▼

answered Mar 24 '16 at 03:44 PM

avatar image

MiKom
535 17 10 39

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question