Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build for Android in Unreal Engine 5.2 #215

Open
ryanjon2040 opened this issue Jun 19, 2023 · 5 comments
Open

Unable to build for Android in Unreal Engine 5.2 #215

ryanjon2040 opened this issue Jun 19, 2023 · 5 comments
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug

Comments

@ryanjon2040
Copy link

After adding BugSnag to my project in Unreal Engine 5.2 I'm getting the below error and there is no information on the docs or anywhere on how to fix it.

Error screenshot:
image

@ryanjon2040
Copy link
Author

Default Unreal Engine auto upload doesn't work with newer NDK's so I had to resort to using bugsnag-cli to manually upload symbols. The problem is the usage of legacy NDK symbols (which was deprecated around NDK 17 IIRC and Unreal uses 25+) being uploaded and I don't know why the BugSnag team has not bothered to update the plugin or their documentation.

For anyone facing this issue make sure to disable Auto Upload Symbol Files option in Project Settings -> Plugins -> BugSnag settings.

image

After that build you Android project and follow the bugsnag-cli documentation to upload the symbols or for those who are on Windows, feel free to use this batch script.

@echo off
if not exist bugsnag-cli.exe (goto error_cli)

set api_key=

if [%api_key%]==[] (goto error_api)

set app_manifest_filename=AndroidManifest.xml
set app_manifest_path=%cd%\Intermediate\Android\gradle\app\build\intermediates\merged_manifests\release
set app_manifest=%app_manifest_path%\%app_manifest_filename%
set so_filename=libUnreal.so
set so_path=%cd%\Intermediate\Android\gradle\app\build\intermediates\merged_native_libs\release\out\lib\arm64-v8a
set so_file=%so_path%\%so_filename%
set mapping_filename=mapping.txt
set mapping_path=%cd%\Intermediate\Android\gradle\app\build\outputs\mapping\release
set mapping_file=%mapping_path%\%mapping_filename%

if not exist %app_manifest% (goto error_manifest)
if not exist %so_file% (goto error_so)
if not exist %mapping_file% (goto error_mapping)

set /p app_version="What is the app version? (example: 1.0, 2.0.3 etc.) "
set /p version_code="What is the store version? (Found in Project Settings -> Platforms -> Android -> Store Version) "

@echo Begin upload...
bugsnag-cli.exe create-build --api-key=%api_key% --app-version=%app_version% --app-version-code=%version_code% && bugsnag-cli upload android-ndk %so_file% --api-key=%api_key% --app-manifest=%app_manifest% && bugsnag-cli upload android-proguard %mapping_file% --api-key=%api_key% --app-manifest=%app_manifest%
goto exit

:error_cli
@echo bugsnag-cli.exe was not found in "%cd%". Please download from "https://github.com/bugsnag/bugsnag-cli/releases" and keep it next to this bat file.
goto exit

:error_api
@echo api_key not set. Edit this bat file and set your "api_key" which can be found in Project Settings from your BugSnag dashboard.
goto exit

:error_manifest
@echo "%app_manifest_filename%" does not exist in "%app_manifest_path%". Make sure you packaged your Android project successfully.
goto exit

:error_so
@echo "%so_filename%" does not exist in "%so_path%". Make sure you packaged your Android project successfully.
goto exit

:error_mapping
@echo "%mapping_filename%" does not exist in "%mapping_path%". Make sure you packaged your Android project successfully.
goto exit

:exit
pause

@johnkiely1
Copy link
Member

Hi @ryanjon2040,

Did you manage to fix find a workaround to the original issue you were encountering? As Unreal 5.2 is a relatively new release (11 May 2023) we have not yet tested Bugsnag running in this version. Any information you can share on this would be helpful as we have a task on our backlog to test the compatibility with 5.2.

In relation to the NDK mappings, Google changed the included objdump utility in version 23 of NDK which means the standard Bugsnag Gradle plugin will not work when using ndk23 or above. This has worked for Unreal versions up until now. It would appear that with the release of 5.2 it is now using v25 therefore our recommendation would to use the Bugsnag cli as you are suggesting. The cli has been developed with this, along with a number of other uses, in mind.

@johnkiely1 johnkiely1 added the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label Jun 20, 2023
@ryanjon2040
Copy link
Author

ryanjon2040 commented Jun 20, 2023

Hi @johnkiely1

First of all I apologize in case the previous comment came out rude. Now to the workaround, as I mentioned in my previous comment not using automatic upload and manually uploading the NDK symbol and mapping is the only option now.

If you just want to fix the original error and upload legacy symbols then download this (thanks to Atiq from Stack Overflow) and extract it to C:\Users\<your-username>\AppData\Local\Android\Sdk\ndk\<version>\toolchains folder.

Then in Unreal Engine if you are using automatic BugSnag upload then make sure to disable Android File Server otherwise build will fail. Either disable the whole plugin or disable it in Project Settings -> Plugins -> AndroidFileServer

@johnkiely1
Copy link
Member

Thanks @ryanjon2040,

It's worth mentioning in v7 of the bugsnag android gradle plugin we do have the ability to use a newer upload mechanism, which avoids the use objdump however currently we do only use v5 with Unreal builds, so we are going to now look into improving this to make use of v7 to restore the automatic upload for Unreal Engine v5.2. We will update here as soon as we can. In the meantime it looks like your workaround is the best approach.

@johnkiely1 johnkiely1 added bug Confirmed bug backlog We hope to fix this feature/bug in the future and removed awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. labels Jun 20, 2023
@tomlongridge
Copy link
Contributor

@ryanjon2040 - just to let you know that unfortunately we haven't been able to find a working solution for our Gradle plugin that is compatible with the newer NDK tooling as Unreal Engine still uses AGP 4 and our support does not go back that far (for the newer NDK support).

We're therefore looking at removing the automatic upload of Android mappings in a future release and switching to the native-style integrations we use for Android and iOS apps. Using the CLI is one such solution for Android, so thanks for sharing your wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants