[Android] Fix black screen on Android when app is launched (#4418)

* When copying the runtime dependency setreg files to the cache, the name of the registry directory should be all lower case

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Lower case the registry folder name when looking in the asset cache.

Signed-off-by: amzn-sj <srikkant@amazon.com>
This commit is contained in:
SJ
2021-10-01 09:02:09 -07:00
committed by GitHub
parent bf393ec85c
commit b984335b30
2 changed files with 24 additions and 6 deletions
@@ -717,7 +717,9 @@ namespace AZ::SettingsRegistryMergeUtils
if (registry.Get(cacheRootPath, FilePathKey_CacheRootFolder))
{
mergePath = AZStd::move(cacheRootPath);
mergePath /= SettingsRegistryInterface::RegistryFolder;
AZStd::fixed_string<32> registryFolderLower(SettingsRegistryInterface::RegistryFolder);
AZStd::to_lower(registryFolderLower.begin(), registryFolderLower.end());
mergePath /= registryFolderLower;
registry.MergeSettingsFolder(mergePath.Native(), specializations, platform, "", scratchBuffer);
}
@@ -381,6 +381,23 @@ CUSTOM_GRADLE_COPY_NATIVE_CONFIG_BUILD_ARTIFACTS_DEPENDENCY_FORMAT_STR = """
}}
"""
CUSTOM_GRADLE_COPY_REGISTRY_FOLDER_FORMAT_STR = """
task copyRegistryFolder{config}(type: Copy) {{
from ('build/intermediates/cmake/{config_lower}/obj/arm64-v8a/{config_lower}/Registry')
into ('{asset_layout_folder}/registry')
include ('*.setreg')
}}
compile{config}Sources.dependsOn copyRegistryFolder{config}
"""
CUSTOM_GRADLE_COPY_REGISTRY_FOLDER_DEPENDENCY_FORMAT_STR = """
copyRegistryFolder{config}.mustRunAfter {{
tasks.findAll {{ task->task.name.contains('syncLYLayoutMode{config}') }}
}}
"""
CUSTOM_APPLY_ASSET_LAYOUT_TASK_FORMAT_STR = """
task syncLYLayoutMode{config}(type:Exec) {{
workingDir '{working_dir}'
@@ -851,14 +868,13 @@ class AndroidProjectGenerator(object):
config=native_config)
# Copy over settings registry files from the Registry folder with build output directory
gradle_build_env[f'CUSTOM_APPLY_ASSET_LAYOUT_{native_config_upper}_TASK'] += \
CUSTOM_GRADLE_COPY_NATIVE_CONFIG_BUILD_ARTIFACTS_FORMAT_STR.format(config=native_config,
config_lower=native_config_lower,
asset_layout_folder=(self.build_dir / 'app/src/main/assets').resolve().as_posix(),
file_includes='**/Registry/*.setreg')
CUSTOM_GRADLE_COPY_REGISTRY_FOLDER_FORMAT_STR.format(config=native_config,
config_lower=native_config_lower,
asset_layout_folder=(self.build_dir / 'app/src/main/assets').resolve().as_posix())
if self.include_assets_in_apk:
# This is a dependency of the layout sync only if we are including assets in the APK
gradle_build_env[f'CUSTOM_APPLY_ASSET_LAYOUT_{native_config_upper}_TASK'] += \
CUSTOM_GRADLE_COPY_NATIVE_CONFIG_BUILD_ARTIFACTS_DEPENDENCY_FORMAT_STR.format(config=native_config)
CUSTOM_GRADLE_COPY_REGISTRY_FOLDER_DEPENDENCY_FORMAT_STR.format(config=native_config)