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"

Access FJavaWrapper in Android Runtime Plugin

Hi all,

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?

regards

Product Version: UE 4.8
Tags:
more ▼

asked Jun 25 '15 at 09:25 AM in C++ Programming

avatar image

hessling.exo
26 2 3 5

avatar image hessling.exo Jun 25 '15 at 02:53 PM

Okay I found the issue.

Should add the Privateinclude:

/Source/Runtime/Launch/Private"

avatar image robel.jungle Jan 08 '16 at 06:47 PM

Hi Hessling,

I'm having the same issue right now. Can you be more specific about your fix?

What did you add exactly to make it work?

A code sample would be great!

Thanks Robel

avatar image hessling.exo Jan 11 '16 at 01:15 PM

Hi Robel,

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.

Regard, Ingo Hessling

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

1 answer: sort voted first
  1. in the XXX.uplugin file add WhitelistPlatforms": [ "Android", "Win64" ] to Modules

  2. 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

  3. in the c++ code, use PLATFORM_ANDROID MACRO to distinguish the java code and C++ platform code

more ▼

answered Sep 06 '18 at 03:12 AM

avatar image

Lucky.Liu
1 2

(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