Hello!
We recently changed android package name from
com.netspeakgames.hamlet
to
com.netspeakgames.townbuilder
And our Android builds started failing, complaining about not being able to find symbols for OBBDownloaderService or DownloadShim
UATHelper: Packaging (Android (ETC2)): Z:\app\src\main\java\com\epicgames\unreal\DownloadShim.java:3: error: cannot find symbol UATHelper: Packaging (Android (ETC2)): import com.netspeakgames.townbuilder.OBBDownloaderService;
Looking into the intermediate directories, I could confirm that the generated Java files in
\Build\Android\src\com\netspeakgames\townbuilder were present and correct (and had the right package names generated)
They were happily copied to
\Intermediate\Android\arm64\gradle\app\src\main\java\com\netspeakgames\townbuilder
Correctly, but failed to be copied to:
Intermediate\Android\gradle\app\src\main\java\com\netspeakgames
The offending code, it turns out (after a few days of fun logging) was in
UEDeployAndroid.cs in the build tool:
// skip the build directories
string Workname = Filename.Replace(“\\”, “/”);
string DirectoryName = Path.GetDirectoryName(Filename)!.Substring(UnrealBuildGradlePathLength);
if (DirectoryName.Contains(“build”) || Workname.Contains(“/.”))
… continue;
I’ve changed this to:
string folders = DirectoryName.Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries);
if (folders.Any(f => f.Equals(“build”, StringComparison.OrdinalIgnoreCase)) || Workname.Contains(“/.”))
And the build is now fine. If you have any thoughts or comments on a better approach, I’d appreciate it (I also appreciate I could have just called the package something else…but after several days it felt like a weak victory!)