Starting With Augmented Reality in Unreal Engine 4.20 on Android
Posted on Aug 16th, 2020
Today we begin to delve in our steps into using Augmented Reality, shortens to AR, on Android for ourselves. We’ll use my Samsung A30 running Android 10 for this. So, we will delve into all our steps together today.
Get ARCore Running on Unreal Engine 4.20
I tried several times to use UE 4.25.X, I also tried to build 4.20 for myself. After hours of troubles I thought of the more intelligent idea. The documentation would like us to use 4.20 on Google’s side, so I felt I could try that out using the Epic Games launcher.
I stepped into setting up the ARCore example Quickstart from Google. I also needed to install VS2017 again to use it by default for UE. I couldn’t compile 4.20 for myself after trying several times, otherwise I could change it to use VS2019 for myself, so you’d note if you can help me with that it would be appreciated.
I converted the HelloARUnreal project from 4.20 up to 4.20.3 for myself. It warned me that it would need to make a map since it couldn’t be loaded, so I couldn’t get the HelloARUnreal to work, unfortunately. So, I started a blank AR project.
Note, it seems to compile shaders the first time each time I open a new project, so if you don’t have a beefy computer it could take a little time. Similar note, I got the source code for 4.20 to try it out and couldn’t compile the UE for myself on my PC for some reason that doesn’t seem to be documented much.
On the new project I needed to fix the Android NDK. To do so I got android-ndk-r17c. However it took quite a bit of work to get everything working, so I’ll share the end results as I had to fix and adjust several things in several ways. This way it may help others that might need a little help with errors, they can try it out for themselves.
It’s important to note here, the SDK used was the default they shared, the NDK I pointed to the one I mentioned before, r17c, and the JRE I pointed to my Android Studio JRE.
With my Samsung A30 connected I went into the options drop down by Launch. Make sure your phone show’s connection there, it may need you to Release/Claim it again in some cases. Also, you need to under Developer Options, on your device, enable USB Debugging.
Take note, I chose Android_ETC2 here for my Samsung A30. ASTC didn’t work, I didn’t try ETC1 either, you may need to change that for your own device. The build won’t necessarily be slow, for instance the first build creates shaders, so it may at times be slower.
Now, take note, this was just to share it was a slight delay to get the AR to work on my Android device. You should note the biggest choices I made:
- Unreal Engine 4.20.3
- Android Studio
With SDKs for 7.0, 8.0, 9.0, and 10.0
- The configs shown in the images above
This requires android-ndk-r17c.
- An ARCore compatible device, obviously
Mine is the Samsung Galaxy A30
I wont lie, it is interesting to delve into looking at the objects in UE. The main thing we would need to do is work out how to use the engine itself. So, I’ll delve into tests, and lessons, for what would be available for me.
I’ll hopefully be able to share more soon.