o3de / o3de-atom-sampleviewer

Atom sample viewer project for the Open 3D Engine
https://o3de.org
Other
31 stars 35 forks source link

[Android] Application crashes upon loading the SkinnedMesh sample after displaying asserts #638

Open LB-KacperKapusta opened 1 year ago

LB-KacperKapusta commented 1 year ago

Describe the bug AtomSampleViewer application crashes on Android device upon loading the SkinnedMesh sample after the displayed asserts are ignored.

Please refer to the attached video for more information. Please note that Game.log found on the device does not seem to have been generated correctly (might be related to https://github.com/o3de/o3de/issues/12039).

The issue should be considered Critical priority.

First assert:

File: C:/o3de/Gems/Atom/RHI/Vulkan/Code/Source\RHI/Vulkan.h

Condition:

void AZ::Vulkan::AssertSuccess(VkResult)

ASSERT: Vulkan APKI method failed: Device lost

Line: 102

Second assert:

File: C:/o3de/Gems/Atom/RHI/Vulkan/Code/Source/RHI/SwapChain.cpp

Condition:

auto AZ::Vulkan::SwapChain::PresentInternal():(anonymousclass)::operator()(void *) const

Unhandled error for swapchain presentation.

Line: 332

Prerequisites

In this test the following settings have been used:

SET O3DE_ENGINE_PATH=C:\o3de
SET O3DE_PROJECT_PATH=C:\o3de-atom-sampleviewer
SET O3DE_BUILD_ROOT=C:\o3de-build
SET O3DE_ANDROID_SIGNCONFIG_FILE=%O3DE_BUILD_ROOT%\o3de.keystore
SET O3DE_ANDROID_SIGNCONFIG_STORE_PASSWORD=o3de_android
SET O3DE_ANDROID_SIGNCONFIG_KEY_ALIAS=o3de_key
SET O3DE_ANDROID_SIGNCONFIG_KEY_PASSWORD=o3de_android
SET O3DE_ANDROID_SIGNCONFIG_KEY_SIZE=2048
SET O3DE_ANDROID_SIGNCONFIG_VALIDITY_DAYS=10000
SET O3DE_ANDROID_DN="cn=atom-sample-viewer, ou=o3de, o=LF, c=US"
set O3DE_ANDROID_SDK_PATH=C:\Android\Sdk
set O3DE_ANDROID_NDK_VERSION=22.1.7171670
set O3DE_ANDROID_SDK_API_LEVEL=30
set O3DE_ANDROID_ASSET_MODE=LOOSE
set O3DE_ANDROID_DEPLOY_TYPE=BOTH

Steps to reproduce

  1. Generate KeyStore to allow APK signing: keytool -genkey -keystore %O3DE_ANDROID_SIGNCONFIG_FILE% -storepass %O3DE_ANDROID_SIGNCONFIG_STORE_PASSWORD% -alias %O3DE_ANDROID_SIGNCONFIG_KEY_ALIAS% -keypass %O3DE_ANDROID_SIGNCONFIG_KEY_PASSWORD% -keyalg RSA -keysize %O3DE_ANDROID_SIGNCONFIG_KEY_SIZE% -validity %O3DE_ANDROID_SIGNCONFIG_VALIDITY_DAYS% -dname %O3DE_ANDROID_DN%
  2. Use Python to run generate_android_project.py: %O3DE_ENGINE_PATH%\python\python.cmd %O3DE_ENGINE_PATH%\cmake\Tools\Platform\Android\generate_android_project.py --engine-root %O3DE_ENGINE_PATH% --project-path %O3DE_PROJECT_PATH% --build-dir %O3DE_BUILD_ROOT%\android --third-party-path %USERPROFILE%\.o3de\3rdParty --android-sdk-path %O3DE_ANDROID_SDK_PATH% --android-ndk-version %O3DE_ANDROID_NDK_VERSION% --android-sdk-platform %O3DE_ANDROID_SDK_API_LEVEL% --enable-unity-build --asset-mode %O3DE_ANDROID_ASSET_MODE% --signconfig-store-file %O3DE_ANDROID_SIGNCONFIG_FILE% --signconfig-store-password %O3DE_ANDROID_SIGNCONFIG_STORE_PASSWORD% --signconfig-key-alias %O3DE_ANDROID_SIGNCONFIG_KEY_ALIAS% --signconfig-key-password %O3DE_ANDROID_SIGNCONFIG_KEY_PASSWORD%
  3. Build the Android project: cd %O3DE_BUILD_ROOT%\android gradlew assembleProfile
  4. Deploy the project to a device: %O3DE_ENGINE_PATH%\python\python.cmd %O3DE_ENGINE_PATH%\cmake\Tools\Platform\Android\deploy_android.py --build-dir %O3DE_BUILD_ROOT%\android --configuration profile --clean -t %O3DE_ANDROID_DEPLOY_TYPE%

Expected behavior The SkinnedMesh sample can be loaded without issues in the AtomSampleViewer android application.

Actual behavior The AtomSampleViewer android application crashes upon loading the SkinnedMesh sample.

Screenshots/Video

https://github.com/o3de/o3de-atom-sampleviewer/assets/86953659/b5a5918a-acc4-4291-a639-6512aa8922d2

Found in Branch Development

Commit ID from o3de/o3de Repository o3de - https://github.com/o3de/o3de/commit/a62f43b63c7ee3e92cc0d125a087e08788c60884 o3de-atom-sampleviewer - https://github.com/o3de/o3de-atom-sampleviewer/commit/d2890bfca72a20695b700e44b9cfd6aec4072eb0

Desktop/Device

Additional context Game.log

Please note that we were not able to gather the LogCat output from the Android Studio due to the time constraints and the following error occurring:

Starting Gradle Daemon...
Gradle Daemon started in 969 ms
FAILURE: Build failed with an exception.
* Where:
Initialization script 'C:\Users\GPC-93427\AppData\Local\Temp\ijmapper.gradle'
* What went wrong:
Could not compile initialization script 'C:\Users\GPC-93427\AppData\Local\Temp\ijmapper.gradle'.
> startup failed:
  General error during conversion: Unsupported class file major version 61
  java.lang.IllegalArgumentException: Unsupported class file major version 61
  1 error
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.groovy.scripts.ScriptCompilationException: Could not compile initialization script 'C:\Users\GPC-93427\AppData\Local\Temp\ijmapper.gradle'.
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:189)
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:170)
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:156)
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:277)
1 error
    at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:139)
    ... 154 more
* Get more help at https://help.gradle.org/
BUILD FAILED in 4s