Forum Discussion
daver99
2 years agoProtege
Getting to Android 32 with Unreal 4.27.2
Hi all,
Quick summary here of what we needed to do to get our app(s) updated to API 32 - with Unreal 4.27.2
A bunch of this info seems spread out in other posts and I though collecting it in one spot might save others some pain
Updating to API 32:
- using Android Studio to configure the SDK to api 32 - just SDK Platform 32 and Sources for 32 are needed (we still have 29 installed)
- Tools stay at 29 - we have 29.0.2 and 29.0.3 installed
- Use the editor to set your android API to 32
Now problems we had with 32..
-Sideloads of builds installs didn't work,
-Dev builds couldn't save logs
-We couldn't launch one app from another
Sideload fixes require changing /Engine/Source/Programs/AutomationTool/Android/AndroidPlatform.Automation.cs
Near the top.. add 'Android' infront of obb --> private const string TargetAndroidLocation = "Android/obb/";
Then in GenerateInstallBatchFile, around line 950 there are to spots where "$STORAGE/Android/" needs to be just "$STORAGE/"
Also in that same method near the top.. make this always true..
bool bNeedGrantStoragePermission = true; //bRequireRuntimeStoragePermission && !bIsDistribution;
To get logs and general functioning working:
Some tags need to be added to DefaultEngine.ini, (..some of the following may not apply to all apps..)
[/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]
bUseExternalFilesDir=true
+ExtraManifestNodeTags=xmlns:tools="http://schemas.android.com/tools"
+ExtraApplicationNodeTags=tools:replace="android:name"
(the above is needed if you use Vivox later releases)
+ExtraApplicationNodeTags=android:allowBackup='false'
ExtraApplicationSettings=
+ExtraActivityNodeTags=android:exported="true"
ExtraActivitySettings=
+ExtraPermissions=android.permission.INTERNET
+ExtraPermissions="com.qti.permission.PROFILER "
+ExtraPermissions=android.permission.WRITE_EXTERNAL_STORAGE
+ExtraPermissions=android.permission.READ_EXTERNAL_STORAGE
+ExtraPermissions=android.permission.WRITE_INTERNAL_STORAGE
+ExtraPermissions=android.permission.READ_INTERNAL_STORAGE
+ExtraPermissions=android.permission.READ_MEDIA_IMAGES
+ExtraPermissions=android.permission.READ_MEDIA_VIDEO
+ExtraPermissions=android.permission.READ_MEDIA_AUDIO
+ExtraPermissions=android.permission.ACCESS_MEDIA_LOCATION
+ExtraPermissions=android.permission.MANAGE_EXTERNAL_STORAGE
bAndroidVoiceEnabled=False
Also to get the logs saving on the device, we could not see how to grant permissions to save them where it usually wants to. I think that is truly locked off, but instead change the destination to use "Downloads" instead of UE4Game as the root.. In AndroidPlatformFile.cpp
//#define FILEBASE_DIRECTORY "/UE4Game/"
#define FILEBASE_DIRECTORY "/Download/"
Our apps use a central launcher so to start those packages you must be able to get visibility of them, (new in 30, I think) so some additions to the AndroidManifest.xml are needed -- this can be done in UEDeployAndroid.cs -- there is a section that checks for API >= 30 -- and it creates a "query" section.. to this we added the following (I've included the tag to end the <queries> for ref)
Text.AppendLine("\t\t<intent>");
Text.AppendLine("\t\t\t<action android:name=\"android.intent.action.MAIN\" />");
Text.AppendLine("\t\t\t<category android:name=\"android.intent.category.INFO\" />");
Text.AppendLine("\t\t\t<category android:name=\"com.oculus.intent.category.VR\" />");
Text.AppendLine("\t\t</intent>");
Text.AppendLine("\t</queries>");
This lets our app discover and launch other apps.
Hope this helps some one else!
DR
-
13 Replies
- XilentRivalExplorer
Just wanted to say thank you for this! Really saved our team in time for a client demo tomorrow.
It's really unfortunate how left in the dust 4.27 is becoming. We're dreading the migration to 5.2+ for the Quest 3 (currently on Quest Pro), but it's looking like we won't have much of a choice.- daver99Protege
ya.. We are in the process of starting to consider maybe doing the 5.2 upgrade
- ericmichaelmooreHonored Guest
I tried uploading my latest DLC and game update to AppLab, and (to my surprise) they're now requiring the update from SDK 29 to 32.
I tried all these changes, but to no avail. For clarity, can you answer some of the following:
- Were you experiencing the stick during loading at the 3 dots? If on the Oculus source build, are you using the Plugins --> OculusVR --> Mobile --> OS Splash Screen, and did it show prior to the stick?
- Device? Quest 2?
- Are you using the Oculus 4.27.2 source build?
- Android Studio version? 4.0?
- Can you post Gradle info? Gradle 6.1.1?
- What version of Android SDK Build-Tools? Version 34 (only one currently available) but building for 32.0.0?
I've been at this for over 2 weeks. Any help is GREATLY appreciated!
Side note, I tried upgrading my project in multiple versions of UE, including 5.1, and 5.2. There are over 10,000 build warnings and over 100 build errors. You might want to get started with that update ASAP. 😉
- daver99Protege
We are using android studio 4.0
Android SDK Build tools 29.0.2 and 29.0.3 installed - tried more recent tools, but had issues, so stick with 29
Yes - this 4.27.2 source build
The lack of startup of sideloaded builds was due to the obb files being installed in the wrong spot, or failing to install. Our fix was (from first post)
"Sideload fixes require changing /Engine/Source/Programs/AutomationTool/Android/AndroidPlatform.Automation.cs
Near the top.. add 'Android' infront of obb --> private const string TargetAndroidLocation = "Android/obb/";
Then in GenerateInstallBatchFile, around line 950 there are to spots where "$STORAGE/Android/" needs to be just "$STORAGE/"
Also in that same method near the top.. make this always true..
bool bNeedGrantStoragePermission = true; //bRequireRuntimeStoragePermission && !bIsDistribution;
"Be sure to use adb to capture log files and search them for your app name on startup.
e.g. Adb logcat >temp.txt
[try to launch your app]cntrl-c the logcat capture and then look at temp.txt to see if there are any clues
As for gradle - I know very little about that side.. this from our gradle.properties:
org.gradle.daemon=falseorg.gradle.jvmargs=-XX:MaxHeapSize=4096m -Xmx9216mandroid.injected.testOnly=falseandroid.useAndroidX=trueandroid.enableJetifier=trueCOMPILE_SDK_VERSION=32BUILD_TOOLS_VERSION=29.0.3MIN_SDK_VERSION=32TARGET_SDK_VERSION=32
And we seem to be usingdistributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
Hope this helps.DR
- FokkusuESExplorer
Hi, we are also dealing with this, your post daver99 is incredibly useful but alas is not working for us at the moment, we are still attempting engine rebuilds trying different NDKs from 21 21d and 22 and 23.... is possible I'm wasting my time, but after I have done everything you said it worked for you and have it produce APKs that lead into the 3 dots stuck problem on startup, I'm loosing my mind.
If I find anything I will also post it here. I hate that we have to fend for ourselves in the dark like this with unreal and meta's documentation being outdated and the repository for 4.27 not getting any updates- XilentRivalExplorer
Would you mind elaborating on your issue/solution a little more? We're also running into the issue of our APKs both not properly installing via the Meta Quest Developer Hub and now failing to upload to our release channel without any changes to our project. When uploading to our release channel, we don't get any detailed error message besides "The build you're trying to upload has failed"
However when trying to install to device via MQDH, we get this installation failure error, although the app still installs (and runs) perfectly fine when installing via the produced Install and Uninstall .bat scripts from UE:
failed to copy '[MyFullBuildPath]\main.10.com.AppDomain.AppProject.obb' to
'/sdcard/Android/obb/com.com.AppDomain.AppProject/main.10.com.AppDomain.AppProject.obb': remote secure_mkdirs failed: Operation not permittedWe haven't changed anything with our project except for update our OVR 4.27 branch to latest, which has the updated v57 API. We actually had our builds working fine with Android 32 thanks to daver99's original posts!
Any ideas?
- XilentRivalExplorer
Thanks for the replies! So I feel really silly. There were a couple things causing my issues. With regards to the MQDH sideloading installation issue, we forgot to add Meta Quest 3 to the Package for Meta Quest Devices property in the project settings... we did implement functional support for Quest 3, but just didn't add the build support for it, which caused that MQDH error, but it would still install and work on the Quest 3 (weirdly enough). Maybe it's because we also support the Quest Pro? Not sure.
The other issue of not being able to upload builds to our release channel was... not adding quotes to our build notes lol I think I just had a total brain fart and forgot that was a requirement, although the provided error really didn't help. Issues resolved though, and everything is working as expected!
- FokkusuESExplorer
I'm glad to read this, also serves a reminder for us when we start uploading to the MQDH
- FokkusuESExplorer
Update, we did upload today to applab using MQDH, it worked perfectly it was signed and all that, we tried it on 2 different quest 2 with different accounts, worked perfectly, it was a joyous day!
- DigitalBugProtege
Hi all.
I have a problem with writing a file to a folder. Perhaps you can help me with my problem.
I want to read/save files to some shared folder which is in the root of Oculus. So that the user can find this folder and download the file to the computer.
For UE5.2.1 and SDK 29 everything works. But for UE5.2.1 and SDK 32 it does not work.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 11 months ago