I cannot deploy an project whose API Level is 31 on Android in accordance with this requirement.
[Background]
Packaging a vanilla project for test has succeeded with editing some files (explain it later), but I cannot deploy it on device.
The error part when launching the game is as below:
Summary
LogPlayLevel: Failure [DELETE_FAILED_INTERNAL_ERROR]
LogPlayLevel: Took 0.1758856s to run adb.exe, ExitCode=1
LogPlayLevel: Running: C:\Users\username\AppData\Local\Android\Sdk\platform-tools\adb.exe -s 27191JEGR25829 install “C:\Users\username\Documents\Unreal Projects\MyProject2\Binaries/Android\MyProject2-arm64.apk”
LogPlayLevel: adb: failed to install C:\Users\username\Documents\Unreal Projects\MyProject2\Binaries/Android\MyProject2-arm64.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl666559365.tmp/base.apk (at Binary XML file line #55): com.epicgames.ue4.SplashActivity: Targeting S+ (version 31 and above) requ
ires that an explicit value for android:exported be defined when intent filters are present]
LogPlayLevel: Performing Streamed Install
LogPlayLevel: Took 3.7226355s to run adb.exe, ExitCode=1
LogPlayLevel: Error: ERROR: Installation of apk ‘C:\Users\username\Documents\Unreal Projects\MyProject2\Binaries/Android\MyProject2-arm64.apk’ failed: [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl666559365.tmp/base.apk (at Binary XML file line #55): com.epicgames.ue4.SplashActivity: Targeting S+ (version 31 and a
bove) requires that an explicit value for android:exported be defined when intent filters are present]
LogPlayLevel: Performing Streamed Install
LogPlayLevel: (see C:\Users\username\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+UE_4.27\Log.txt for full exception trace)
LogPlayLevel: AutomationTool exiting with ExitCode=35 (Error_AppInstallFailed)
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 61.801483
LogPlayLevel: BUILD FAILED
PackagingResults: Error: 起動に失敗しました! Failed to Install app
To fllow the instruction, I found the code creating the xml in Engine\Source\Programs\UnrealBuildTool\Android\UEDeployAndroid.cs.
Summary
if (bShowLaunchImage)
{
// normal application settings
Text.AppendLine("\t\t<activity android:name=\"com.epicgames.ue4.SplashActivity\"");
Text.AppendLine("\t\t android:label=\"@string/app_name\"");
Text.AppendLine("\t\t android:theme=\"@style/UE4SplashTheme\"");
Text.AppendLine("\t\t android:launchMode=\"singleTask\"");
Text.AppendLine(string.Format("\t\t android:screenOrientation=\"{0}\"", Orientation));
Text.AppendLine(string.Format("\t\t android:debuggable=\"{0}\">", bIsForDistribution ? "false" : "true"));
Text.AppendLine("\t\t\t<intent-filter>");
Text.AppendLine("\t\t\t\t<action android:name=\"android.intent.action.MAIN\" />");
Text.AppendLine(string.Format("\t\t\t\t<category android:name=\"android.intent.category.LAUNCHER\" />"));
Text.AppendLine("\t\t\t</intent-filter>");
Text.AppendLine("\t\t</activity>");
Text.AppendLine("\t\t<activity android:name=\"com.epicgames.ue4.GameActivity\"");
Text.AppendLine("\t\t android:label=\"@string/app_name\"");
Text.AppendLine("\t\t android:theme=\"@style/UE4SplashTheme\"");
Text.AppendLine(bAddDensity ? "\t\t android:configChanges=\"mcc|mnc|uiMode|density|screenSize|smallestScreenSize|screenLayout|orientation|keyboardHidden|keyboard\""
: "\t\t android:configChanges=\"mcc|mnc|uiMode|screenSize|smallestScreenSize|screenLayout|orientation|keyboardHidden|keyboard\"");
}
[WHAT I DID]
-
Decapitalized the packange name. I read it must be lower case somewhere on the Internet.
com.YourCompany.[PROJECT] → com.comp.prj -
Renamed two “d8” files to “dx”. The previous errors are that they were missing:
- AppData\Local\Android\Sdk\build-tools\31.0.0\d8.bat
- AppData\Local\Android\Sdk\build-tools\33.0.0\lib\d8.jar
- Raised gradle version 3.5.3 to 4.0.0 by editing UE_4.27\Engine\Build\Android\Java\gradle\build.gradle.
I confirmed that an API 31 project can be deployed on Android Studio, and just imitated the gradle. This change was affected, but probably no meaning for this problem.
[SETTINGS]
UE4.27 and Android Studio 4.0.
Project Settings:
I set android:exported=“ture” for UE4.GameActivity, of coure.
[Questions]
I think it would be successful or get just some similar errors for other tags like activity if I added one line Text.AppendLine(“\t\t android:exported="true"”); into com.epicgames.ue4.SplashActivity part and could build it.
So my questions are:
-
Are my procedure and estimate correct?
-
If 1. is yes, is it possible to build only C# code on UE4 engine? I don’t want to take much time to fully build UE4.
-
If 1. is no, please tell me a right method.
Even if 1. is yes, any other solution will be very welcome.
Thanks in advance.