question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MAUI-Android-Release package compiled under W11 not working

See original GitHub issue

Description

MAUI Android (API31) application not working when compiled for Release, under Windows 11 (the application crashes right after the splash screen).

The application runs when compiled in Debug mode. It also works perfectly when compiled for Release or Debug under Windows 10.

Trimmining and AOT have been disabled in Release mode due to other issues.

Error message from the Device Log:

Time	Device Name	Type	PID	Tag	Message
11-08 14:02:48.067	pixel_5_-_api_31	Error	19999	AndroidRuntime	java.lang.NoSuchMethodError: no non-static method "Landroidx/coordinatorlayout/widget/CoordinatorLayout$LayoutParams;.setBehavior(Landroidx/coordinatorlayout/widget/CoordinatorLayout$Behavior;)V"
	at crc6488302ad6e9e4df1a.MauiAppCompatActivity.n_onCreate(Native Method)
	at crc6488302ad6e9e4df1a.MauiAppCompatActivity.onCreate(Unknown Source:0)
	at android.app.Activity.performCreate(Activity.java:8051)
	at android.app.Activity.performCreate(Activity.java:8031)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7839)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Why is this method missing when compiled for Release on Windows 11? What are we missing? Do we need to add some specific configuration, whatever to make this work? How to guess what is creating the issue? The error message is not very explicit.

An empty/default MAUI application works as expected when compiled for Release on Windows 11. So, there is something in our application creating this issue.

Steps to Reproduce

I cannot share the code source through this channel.

Link to public reproduction project repository

No public repo

Version with bug

6.0.486 (current)

Last version that worked well

6.0.424

Affected platforms

Android

Affected platform versions

Android 12 and up

Did you find any workaround?

No workaround found.

Relevant log output

Time	Device Name	Type	PID	Tag	Message
11-08 14:02:48.067	pixel_5_-_api_31	Error	19999	AndroidRuntime	FATAL EXCEPTION: main
...
11-08 14:02:48.067	pixel_5_-_api_31	Error	19999	AndroidRuntime	java.lang.NoSuchMethodError: no non-static method "Landroidx/coordinatorlayout/widget/CoordinatorLayout$LayoutParams;.setBehavior(Landroidx/coordinatorlayout/widget/CoordinatorLayout$Behavior;)V"
	at crc6488302ad6e9e4df1a.MauiAppCompatActivity.n_onCreate(Native Method)
	at crc6488302ad6e9e4df1a.MauiAppCompatActivity.onCreate(Unknown Source:0)
	at android.app.Activity.performCreate(Activity.java:8051)
	at android.app.Activity.performCreate(Activity.java:8031)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7839)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mattleibowcommented, Nov 10, 2022

@jonmikeli @jonathanpeppers I think the best and easiest way is to open a new issue in VS feedbug and upload logs and screenshots privately. You can link to it here and we can see it there.

That issue will eventually come back here, but we can use it for now to keep all your secrets hidden on our private servers in the cloud. 😄

1reaction
mattleibowcommented, Nov 11, 2022

Please open a new issue so we can track that better. Thanks!

And, glad you got the app building!

Read more comments on GitHub >

github_iconTop Results From Across the Web

MAUI app not working in release mode but it ...
My MAUI App when running in Debug mode in a emulator is working good but it is not running when I run this...
Read more >
Troubleshoot known issues - .NET MAUI
The solution to this issue on Windows is to uninstall the .NET MAUI workloads through the CLI, uninstall any .NET SDKs in Control...
Read more >
App failing to install in release mode but working in debug
Instantly closes and does not work when opening app in android. The workaround is to clear out obj and build folder and then...
Read more >
Bringing the power of AI to Windows 11 - unlocking a new era ...
We are introducing Windows Copilot, making Windows 11 the first PC platform to announce centralized AI assistance to help people easily take ...
Read more >
.NET MAUI Tutorial for Beginners - Build iOS, Android, macOS ...
Let's start our journey together to build beautiful native multi-platform apps with .NET MAUI, C#, .NET, and Visual Studio! In this video I ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found