4.9 custom Java class gets deleted by AutomationTool

I want to migrate a Project from Unreal Engine 4.7.6 to Version 4.9.

The project uses a modified GameActivity.java and an attached JNIContainer.java which handles Sensordata from Android API and pushes it via JNI to C++.

I put the modified GameActivity.java and my JINContainer.java in /Build/Android/src/com/epicgames/ue4/
but this does not work in Unreal Engine 4.9 anymore. The files get deleted and the log says

MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: Cleaning up files based on template dir F:\Unreal Projects\GearVRNavigator 4.9\Build\Android\src\com\YourCompany\GearVRNavigator
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: Cleaning up file F:\Unreal Projects\GearVRNavigator 4.9\Build\Android\src\com\epicgames\ue4\GameActivity.java with path F:\Unreal Projects\GearVRNavigator 4.9\Build\Android\src\com\epicgames\ue4
MainFrameActions: Packaging (Android (ETC2)): UnrealBuildTool: Cleaning up file F:\Unreal Projects\GearVRNavigator 4.9\Build\Android\src\com\epicgames\ue4\JNIContainer.java with path F:\Unreal Projects\GearVRNavigator 4.9\Build\Android\src\com\epicgames\ue4 

is there any other way to put modified and own Java files in my project?

New: A new Android plugin system is
included in 4.10 and the GearVR plugin
now uses it. Changes to the generated
AndroidManifest.xml,
proguard-project.xt, and
GameActivity.java may be made during
packaging along with staging files by
adding an AndroidPlugin property in
their build.cs to reference an XML
file containing commands; see
GearVR.build.cs and GearVR_APL.xml for
an example. AndroidPluginLanguage.cs
documents the commands available.

I now used the APL introduced in Unreal Engine 4.10 to put my own Java files in my project. Therefore i created a project plugin and declared an XML file.

1 Like