Xamarin-android: [Bug] "typemap: module matching MVID [xxxxxxx] not found." A lot of android logs

Created on 9 Jun 2020  Â·  13Comments  Â·  Source: xamarin/xamarin-android

Release build using Xamarin Android SDK v10.3.1.4, I will see a large number of logs below.

monodroid-assembly typemap: module matching MVID [49B5F91A-2F8E-439E-AD20-F837EB41AFF4] not found.

The following command was executed.

> adb shell setprop mono.debug.log all

And when you view the log, it became the following log.

monodroid-assembly typemap: module matching MVID [49B5F91A-2F8E-439E-AD20-F837EB41AFF4] not found.
monodroid typemap: failed to map managed type to Java type: System.Byte, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cecToken=7cec85d7bea7798e (Module: ID: Module: 49b5f91a-2f8e-439e-ad20-f837eb41aff4; Type token: 33554569)

I think its same issue with #4727. I want you to fix this, too.

_Originally posted by @kuramochia in https://github.com/xamarin/xamarin-android/issues/4727#issuecomment-641055033_

App Runtime

All 13 comments

The fix for Issue #4727 in 755a521d0925e648159acaf04998e43c1e462f04 was to turn the messages from warning messages, which were always written, to info messages, which would only be shown if "assembly" messages were enabled.

By running adb shell set prop debug.mono.log all, you have indicated that you want all messages shown. As such, all messages are shown, and is generally considered to be a Bad Ideaâ„¢, as LREF logging is also enabled ("all" means all), which will quickly drown out logcat.

This is By Designâ„¢.

If you don't want all messages shown, then don't enable them all, which can be done by clearing the debug.mono.log system property:

adb shell setprop debug.mono.log "''"

@jonpryor below message can change to info level?

monodroid-assembly typemap: module matching MVID [49B5F91A-2F8E-439E-AD20-F837EB41AFF4] not found.

this message shown in large number of logs.

adb shell setprop debug.mono.log just checked why this log is logged.

Just to make sure I am not missing something. I never had any monodroid warning error in my Release build before this most recent Visual Studio upgrade to 16.6.2. Now I get these errors every few seconds. Why did this just start? How can I prevent this from logging in a production device if its a benign warning?
W/monodroid-assembly(5608): typemap: module matching MVID [96E78666-3B05-47DD-A3A2-B357695888AB] not found.

Thanks for the questions. There is a new candidate change now in progress to make these other typemap messages informational also, like the previous messages that were changed for #4727.

I will reopen this issue for to help track when that candidate change is merged, and then, as in #4727, I will update this item with version information when the changes are available in a published version of Xamarin.Android. Thanks!

thanks grendello and Brendan!

@kuramochia, the new fix grendello added in #4831 is specifically targeting the following message:

monodroid-assembly typemap: module matching MVID [49B5F91A-2F8E-439E-AD20-F837EB41AFF4] not found.

That fix should take care of the majority of the messages you are seeing, but as I was discussing this more with grendello and the team, a question came up about the second message you mentioned:

monodroid typemap: failed to map managed type to Java type: System.Byte, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cecToken=7cec85d7bea7798e (Module: ID: Module: 49b5f91a-2f8e-439e-ad20-f837eb41aff4; Type token: 33554569)

If you might be able to share your project or a trimmed down sample project that produces that second message, the team would be interested to take a look. If the project contains private information, one option is to attach it on a new Visual Studio Developer Community feedback item via Help > Send Feedback > Report a Problem in Visual Studio. Another option would be to put the sample in a private GitHub repository and add brendanzagaeski or grendello with view permissions. Thanks in advance!

One idea is that this second message could appear in cases where adjusting the app code to use a .NET base class library type instead of a binding for a Java type code would improve performance, so the team would be interested to find out if that case matches your app or if there's another scenario that Xamarin.Android might need to handle differently.

A weird thing about this code as I was trying to find exactly where this is happening in code I found a couple of interesting things. When I am in Debug mode I have no errors at all. Its an Android 9 app running Services. Our main service is essentially using an AudioRecord and raising that buffer to a third party that is waiting for a wake word to be spoken. We also have another service that manages the devices LEDs. This service would sometimes get raised on the UI thread causing a delay between the third party responding to the wake word because it had a Task Delay which paused everything on the top. I changed this to execute on ThreadPool
ThreadPool.QueueUserWorkItem(abc => doit);
Long story short only in Release mode would I see any of these logs and I also see this error
06-18 11:47:23.515: I/chatty(13385): uid=1000(system) Thread Pool Wor identical 1387 lines
In Android project Properties -> Build I unchecked one setting "Optimize Code". Once this was off the warnings and chatty messages went away. I thought the issue was coming from Proguard but it seems like just this setting was throwing it.
To answer your question with code, I will see if I can get this example. The project itself is a big one with lots of moving parts so it will take some detective work to figure out exactly what code is doing this. thanks so much for your help with this!
Mark Lane

Thanks @brendanzagaeski !

Second message shown only below command.

> adb shell setprop mono.debug.log

I thinks this message is good without change.

monodroid typemap: failed to map managed type to Java type: System.Byte, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cecToken=7cec85d7bea7798e (Module: ID: Module: 49b5f91a-2f8e-439e-ad20-f837eb41aff4; Type token: 33554569)

Ah, perfect. Thanks roninstar and kuramochia for the additional information and sanity checks! The other team members and I will stay attentive for any other reports of unexpectedly verbose typemap messages that might need additional adjustments, but so far, it sounds like the next fix from #4831 will work well.

I'll update this issue as the new Preview and then Release versions become available with the fix.

A weird thing about this code as I was trying to find exactly where this is happening in code I found a couple of interesting things. When I am in Debug mode I have no errors at all. Its an Android 9 app running Services. Our main service is essentially using an AudioRecord and raising that buffer to a third party that is waiting for a

@roninstar Debug mode uses a different typemap implementation, one which doesn't involve MVIDs (which are UUIDs identifying each manage assembly, with the [MVID]:[TypeToken] pair uniquely identifying every managed type in the typemap) and this is the reason you see these messages only in Release builds.

_Release status update_

A new Preview version of Xamarin.Android has now been published that includes the fix for this item to prevent showing the extra "module matching MVID ... not found" messages unless assembly logging as been explicitly enabled. The fix is not yet included in a Release version. I will update this again when a Release version is available that includes the fix.

Fix included in Xamarin.Android 11.0.0.3.

Fix included on Windows in Visual Studio 2019 version 16.7 Preview 4. To try the Preview version that includes the fix, check for the latest updates in Visual Studio Preview.

Fix included on macOS in Visual Studio 2019 for Mac version 8.7 Preview 4. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel.

_Release status update_

A new Release version of Xamarin.Android has now been published that includes the fix for this item to prevent showing the extra "module matching MVID ... not found" messages unless assembly logging as been explicitly enabled.

Fix included in Xamarin.Android SDK version 11.0.0.3.

Fix included on Windows in Visual Studio 2019 version 16.7. To get the new version that includes the fix, check for the latest updates or install the most recent release from https://visualstudio.microsoft.com/downloads/.

Fix included on macOS in Visual Studio 2019 for Mac version 8.7. To get the new version that includes the fix, check for the latest updates on the Stable updater channel.

Awesome! Thanks so much!!

Mark Lane
Director of Software Engineering
HandsFree Health
[email protected]
phone 484-645-0677
www.handsfreehealth.com

On Aug 5, 2020, at 6:30 PM, Brendan Zagaeski notifications@github.com wrote:



Release status update

A new Release version of Xamarin.Android has now been published that includes the fix for this item to prevent showing the extra "module matching MVID ... not found" messages unless assembly logging as been explicitly enabled.

Fix included in Xamarin.Android SDK version 11.0.0.3.

Fix included on Windows in Visual Studio 2019 version 16.7. To get the new version that includes the fix, check for the latest updateshttps://docs.microsoft.com/visualstudio/install/update-visual-studio?view=vs-2019 or install the most recent release from https://visualstudio.microsoft.com/downloads/.

Fix included on macOS in Visual Studio 2019 for Mac version 8.7. To get the new version that includes the fix, check for the latest updates on the Stable updater channelhttps://docs.microsoft.com/visualstudio/mac/update.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/xamarin/xamarin-android/issues/4791#issuecomment-669553940, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACVZ7A2HTFETVNAW4WFGLYDR7HMPHANCNFSM4NZENYSQ.

Was this page helpful?
0 / 5 - 0 ratings