-
Notifications
You must be signed in to change notification settings - Fork 501
ProGuard enabled crashes Android app #515
Comments
you should added output window with stacktrace information. I am also using proguard and full linking but no problem so far. you may include the apis you are accessing. it could be related to one of them as well. |
@EmilAlipiev I'm trying to use GeoLocation. The app however crashes before it tries to use GeoLocation, it crashes while the splashScreen is being shown. The SampleApp from this repo uses all apis and has the same behavior. I don't get a stacktrace in Visual Studio. However, this is what I picked from the device log:
|
Does it work without progaurd option selected? Linking or link all should work just fine as we have that in our samples today. Do you have your progaurd config? You may need to add some information there so items don't get removed. |
Looking at your error it looks like a general progaurd issue and not anything with essentials if essentials isn't even being run yet, but hard to know. would need to see your progaurd file. I would recommend reading: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/proguard?tabs=vswin a sample I use for the evolve app: https://github.com/xamarinhq/app-conference/blob/master/src/Conference.Android/proguard.cfg I am also interested into understanding why you need progaurd on for the app as it is usually an advanced scenario. |
@jamesmontemagno, to answer your questions:
|
Most likely you will have to add to your progaurd file additional items. I will try to get you a list and working config, but I would try some of what I used for evolve. I am thinking that this would be a problem with just a normal app without Essentials too. Can you try file-> new and see if you have issues without adding essentials. |
Looks like this is something with newer support libraries causing issues: xamarin/AndroidSupportComponents#96 simply add: -keep public class android.support.v7.widget.** { *; } I will add a progaurd file in the repo for reference! |
I have the following:
|
Also, you can use dotfuscator if you want to obfuscate |
Thanks! I can't get proguard to pick up the custom config right now, I'll try that later, after I read through to documentation. |
Description
After consuming the Xamarin.Essentials NuGet package my Android app crashes during start up.
Steps to Reproduce
The problem can be reproduced with the Samples.Android project in this repository.
To reproduce, check "Enable ProGuard" in the Release configuration and try starting the app in release mode.
Expected Behavior
App starts
Actual Behavior
App crashes
Basic Information
The text was updated successfully, but these errors were encountered: