Skip to content

Commit

Permalink
AWSNativeSDK Android/iOS Compile Fix (#253)
Browse files Browse the repository at this point in the history
- Fix Android/iOS AWS SDK compiler error to include AWS-utils lib
dependency
- Revert back AWS SDK to compile with Android API 21 instead of 33.
Note: This was originally bumped to 33 to work around a compiler error
from backtrace(), which only exists in Android API 33. Compile and
installing the APK works fine now. I had originally ran into the issue
using v1.11.264, but now using v1.11.288 this seems to work. AWS
libraries check to see if backtrace is available via
[AWS_HAVE_EXECINFO](https://github.com/ydb-platform/ydb/blob/9bcbbd617cfcf26e791b5f16cac239f3fa1bc632/contrib/restricted/aws/aws-c-common/source/posix/system_info.c#L170).
This variable is set during the [AWS common library feature
test](https://github.com/awslabs/aws-c-common/blob/ae7b067d9274d2d3faa1d3ae42d489a6986661f7/cmake/AwsFeatureTests.cmake#L113).

Using SDK 21 allows older Android device to run with the O3DE AWS gem.

Tested by deploying Multiplayer Sample to an Android phone (API 30)
- Remove Popcorn Fx cmake and code
- Run `D:\prj\o3de\scripts\o3de.bat export-project -es
D:\prj\o3de\scripts\o3de\ExportScripts\export_source_android.py
--project-path D:\prj\multiplayersample\ --log-level INFO --config
release --asset-mode PAK -abp D:\prj\multiplayersample\build\android\
--seedlist
D:\prj\multiplayersample\AssetBundling\SeedLists\GameSeedList.seed
--deploy-to-android`

Fixes o3de/o3de#17827
  • Loading branch information
AMZN-Gene authored May 6, 2024
2 parents caf8100 + 8d6842a commit 30c1304
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions package-system/AWSNativeSDK/FindAWSNativeSDK.cmake.Android
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ if(LY_MONOLITHIC_GAME)
${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common${CMAKE_STATIC_LIBRARY_SUFFIX}
${AWSNATIVE_SDK_LIB_PATH}/libaws-c-compression${CMAKE_STATIC_LIBRARY_SUFFIX}
${AWSNATIVE_SDK_LIB_PATH}/libaws-c-cal${CMAKE_STATIC_LIBRARY_SUFFIX}
${AWSNATIVE_SDK_LIB_PATH}/libaws-c-sdkutils${CMAKE_STATIC_LIBRARY_SUFFIX}
${AWSNATIVE_SDK_LIB_PATH}/libs2n${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
Expand Down
1 change: 1 addition & 0 deletions package-system/AWSNativeSDK/FindAWSNativeSDK.cmake.iOS
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ set(CORE_STATIC_LIBS
${AWSNATIVE_SDK_LIB_PATH}/libaws-c-compression.a
${AWSNATIVE_SDK_LIB_PATH}/libaws-c-cal.a
${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.a
${AWSNATIVE_SDK_LIB_PATH}/libaws-c-sdkutils.a
${AWSNATIVE_SDK_LIB_PATH}/libcurl.a
)

Expand Down
2 changes: 1 addition & 1 deletion package-system/AWSNativeSDK/build_AWSNativeSDK_android.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ call cmake -S %SRC_PATH% -B %BLD_PATH%\%BUILD_TYPE%_%LIB_TYPE% ^
-DBUILD_SHARED_LIBS=%BUILD_SHARED% ^
-DCMAKE_BUILD_TYPE="%BUILD_TYPE%" ^
-DTARGET_ARCH=ANDROID ^
-DANDROID_NATIVE_API_LEVEL=33 ^
-DANDROID_NATIVE_API_LEVEL=21 ^
-DANDROID_ABI=arm64-v8a ^
-DCPP_STANDARD=17 ^
-DCMAKE_C_FLAGS="-fPIC" ^
Expand Down
3 changes: 2 additions & 1 deletion package-system/AWSNativeSDK/build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
]
},
"Android":{
"package_version":"1.11.288-rev1",
"package_version":"1.11.288-rev2",
"depends_on_packages": [
[ "zlib-1.2.11-rev5-android", "73c9e88892c237a3fc6eafc04268ccd9d479e6d55f9df2ed58b236c8f9cf2cae", "" ]
],
Expand All @@ -47,6 +47,7 @@
]
},
"iOS":{
"package_version":"1.11.288-rev2",
"cmake_find_source":"FindAWSNativeSDK.cmake.iOS",
"custom_build_cmd": [
"./build_AWSNativeSDK_ios.sh"
Expand Down
4 changes: 2 additions & 2 deletions package_build_list_host_darwin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"build_from_source": {
"assimp-5.2.5-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Mac --package-root ../../package-system --clean",
"AWSNativeSDK-1.11.288-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Mac --package-root ../../package-system --clean",
"AWSNativeSDK-1.11.288-rev1-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name iOS --package-root ../../package-system --clean",
"AWSNativeSDK-1.11.288-rev2-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name iOS --package-root ../../package-system --clean",
"Lua-5.4.4-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Mac --package-root ../../package-system/Lua/temp --clean",
"Lua-5.4.4-rev1-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name iOS --package-root ../../package-system/Lua/temp --clean",
"AwsIotDeviceSdkCpp-1.15.2-rev2-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --platform-name Mac --package-root ../../package-system --clean",
Expand Down Expand Up @@ -57,7 +57,7 @@
"build_from_folder": {
"assimp-5.2.5-rev1-mac": "package-system/assimp-mac",
"AWSNativeSDK-1.11.288-rev1-mac": "package-system/AWSNativeSDK-mac",
"AWSNativeSDK-1.11.288-rev1-ios": "package-system/AWSNativeSDK-ios",
"AWSNativeSDK-1.11.288-rev2-ios": "package-system/AWSNativeSDK-ios",
"AwsIotDeviceSdkCpp-1.15.2-rev2-mac": "package-system/AwsIotDeviceSdkCpp-mac",
"Lua-5.4.4-rev1-mac": "package-system/Lua/temp/Lua-mac",
"Lua-5.4.4-rev1-ios": "package-system/Lua/temp/Lua-ios",
Expand Down
4 changes: 2 additions & 2 deletions package_build_list_host_windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"azslc-1.8.19-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Windows --package-root ../../package-system/azslc/temp --clean",
"AWSGameLiftServerSDK-5.1.1-rev1-windows": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name windows",
"AwsIotDeviceSdkCpp-1.15.2-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --build-path c:/Temp/awsiot --platform-name Windows --package-root ../../package-system --clean",
"AWSNativeSDK-1.11.288-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Android --package-root ../../package-system --clean",
"AWSNativeSDK-1.11.288-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Android --package-root ../../package-system --clean",
"AWSNativeSDK-1.11.288-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Windows --package-root ../../package-system --clean",
"Blast-v1.1.7_rc2-9-geb169fe-rev2-windows": "package-system/Blast/build_package_image.py --platform-name windows",
"Crashpad-0.8.0-rev1-windows": "package-system/Crashpad/build_package_image.py",
Expand Down Expand Up @@ -71,7 +71,7 @@
"azslc-1.8.19-rev1-windows": "package-system/azslc/temp/azslc-windows",
"AWSGameLiftServerSDK-5.1.1-rev1-windows": "package-system/AWSGameLiftServerSDK-windows",
"AwsIotDeviceSdkCpp-1.15.2-rev1-windows": "package-system/AwsIotDeviceSdkCpp-windows",
"AWSNativeSDK-1.11.288-rev1-android": "package-system/AWSNativeSDK-android",
"AWSNativeSDK-1.11.288-rev2-android": "package-system/AWSNativeSDK-android",
"AWSNativeSDK-1.11.288-rev1-windows": "package-system/AWSNativeSDK-windows",
"Blast-v1.1.7_rc2-9-geb169fe-rev1-windows": "package-system/Blast-windows",
"cityhash-1.1-multiplatform": "package-system/cityhash-multiplatform",
Expand Down

0 comments on commit 30c1304

Please sign in to comment.