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)
This lets our app discover and launch other apps.
Hope this helps some one else!
DR
-
