# How to include a .java file when building an Android APK?

**URL:** <https://forums.unrealengine.com/t/how-to-include-a-java-file-when-building-an-android-apk/873959>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Android, CPP, question\
**Created:** [April 7, 2023, 5:06pm UTC](https://forums.unrealengine.com/t/how-to-include-a-java-file-when-building-an-android-apk/873959 "2023-04-07T17:06:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![woohee0817](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@woohee0817](https://forums.unrealengine.com/u/woohee0817)\
**Post date:** [April 7, 2023, 5:06pm UTC](https://forums.unrealengine.com/t/how-to-include-a-java-file-when-building-an-android-apk/873959/1 "2023-04-07T17:06:22Z")

</div>

I want to create a custom .java file and include this file in APK.  
I created a UPL like below and copied the folder with my Test.java through “prebuildCopies”.  
I built an APK after having build.cs include UPL.

The \Intermediate folder in the project contains the path you copied using “prebuildCopies”, but when I checked the APK that was actually built, the Test.java file was not included as shown in the picture below.

The plug-in in the picture is the plug-in you purchased, and the plug-in is also through “prebuildCopies”.All java files were included.

I’m not used to using Unreal and java at the same time, so I’m leaving a question post because it’s hard to figure out a solution to this problem.  
In fact, due to the above issue, when calling from .cpp, the error "FAndroidApplication::FindJavaClass(“com/immersivecast/doongle/Test”) is received that the path was not found in this function.

---

<div class="post-metadata">

**Author:** ![woohee0817](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@woohee0817](https://forums.unrealengine.com/u/woohee0817)\
**Post date:** [April 9, 2023, 7:00am UTC](https://forums.unrealengine.com/t/how-to-include-a-java-file-when-building-an-android-apk/873959/2 "2023-04-09T07:00:58Z")

</div>

![prebuildCopies](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/2/b/52b0e714f6bd95bfd4bb0668b193cccb451492c7.png)  
 ![source](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/f/f/6ffa80d03d369376fd79c5b55c495088a1ac4c6d.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/8/7c8434c3d6f2290de4f734a51035b669f4093cf9.png)
