App crashes after making build using Dotfuscator RRS feed

  • Question

  • User310920 posted


    I am trying to Obfuscate Xamarin Android build that is a cross platform application using XF. For Obfuscation, i am using trial version of Dotfuscator.

    I can see that code obfuscation is working. I decompiled the apk and checked dll files and inside dll, obfuscated code was there.

    But when i push that apk in mobile, it's got crashed. In error, i can clearly see that few methods are missing from view models.

    When i make build without Dotfuscator, it's working fine. But after making build with Dotfuscator, it's crashes. I made build in release/debug mode and tried all the Linker options with Dotfuscator, but no luck.

    Please help me to understand where exactly the issue is.

    -- Devesh

    Thursday, September 28, 2017 9:30 AM

All replies

  • User310920 posted

    I got the issue. It's mentioned here at


    But i am not very clear that why Renaming exclusion is required.

    Thursday, September 28, 2017 10:34 AM
  • User185459 posted

    DeveshMishra is right. Most of the times it needs to exclude some classes. For me it was custom views that I had inherited and used them in axml files. They get renamed in the project and everywhere they are referenced except inside axml (or xml) files. You have to exclude them to prevent possible crashes. Another possibility is model classes that work with apis and web services. you need to exclude them as well. For example when you deserialize json content from server, all of the attributes has to be the same name as they are. For renaming exclusions you can use .net attributes in the code too. for example you can put [Obfuscation(ApplyToMembers:=True, Exclude:=True)] above of the classes you don't want to rename and all of their members. It is in the System.Reflection namespace. Since dotfuscator doesn't work in debug mode and you can't track where crash happens, logging Device is very useful too.

    Monday, May 21, 2018 6:23 AM
  • User345217 posted

    I remember I had the same situation. Adding debug capability to release mode, I found out Dotfuscator does not support Clicked event for ToolbarItem on Menu defined in Xaml file. I added x:Name to each ToolbarItem and moved those event declarations to page constructor and it worked currectly.

    Sunday, August 12, 2018 12:52 AM