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

Xamarin.Android app fails to run when built on hosted MacOS 12 in Azure DevOps #7400

Closed
djanders77 opened this issue Sep 20, 2022 · 3 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-info Issues that need more information from the author.

Comments

@djanders77
Copy link

djanders77 commented Sep 20, 2022

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

11, 12

Description

We have a Xamarin app that we build and release via Azure DevOps and App Center. Recently, We started getting this error when building the Android app on MacOS-11:

error XA5104: Could not locate the Android NDK. Please make sure the Android NDK is installed in the Android SDK Manager, or if using a custom NDK path, please ensure the $(AndroidNdkDirectory) MSBuild property is set to the custom path.###

According this this thread, the best fix was to start using MacOS-12 as the build agent. This technically fixed the problem and the app built successfully,. but when the app is installed on a device it will not run. The app appears to start up, but quits and can be seen running in the background of the device, Attempting to switch to it causes it to immediately close out. Even stranger, the app runs fine when built from our developer’s local machine, which is also running MacOS-12.

I am currently using the Xamarin.Android task to build the app, but I have tried building it with the MSBuild task as well with the same results.

Steps to Reproduce

  1. Use Azure DevOps hosted MacOS-12 agent to build and release Xamanarin.Android app
  2. Download the .apk, install app on an Android device, and run the app.

Did you find any workaround?

Build/sign the app from the developers' machine, then release via App Center

Relevant log output

No response

@djanders77 djanders77 added Area: App+Library Build Issues when building Library projects or Application projects. needs-triage Issues that need to be assigned. labels Sep 20, 2022
@jonathanpeppers
Copy link
Member

I think we need a log from adb logcat to know where the problem is.

Can you set a system property to enable more logging:

adb shell setprop debug.mono.log default,assembly,mono_log_level=debug,mono_log_mask=all

Then cause the crash, and save the log via adb logcat -d > log.txt and share it here. Thanks!

More details here: https://learn.microsoft.com/xamarin/android/deploy-test/debugging/android-debug-log#accessing-from-the-command-line

@jonathanpeppers jonathanpeppers added need-info Issues that need more information from the author. and removed needs-triage Issues that need to be assigned. labels Sep 28, 2022
@ghost
Copy link

ghost commented Sep 28, 2022

Hi @djanders77. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@jonathanpeppers jonathanpeppers added this to the Under Consideration milestone Sep 28, 2022
@ghost
Copy link

ghost commented Oct 5, 2022

Hi @djanders77. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you.

@ghost ghost closed this as completed Oct 5, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Nov 4, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-info Issues that need more information from the author.
Projects
None yet
Development

No branches or pull requests

3 participants