Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Xamarin Forms Android app crash on boot in Release config with ProGuard on after updated to 27.0.2 #2491

Closed
motoko89 opened this issue Apr 18, 2018 · 4 comments
Labels
s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue.

Comments

@motoko89
Copy link

motoko89 commented Apr 18, 2018

Description

This happens after I upgraded Xamarin.Android.Support.* packages to version 27.0.2. App works when I build and run in Debug but failed when published to the Store. I tried Release config and it indeed crashes on boot

I followed the suggestion here https://bugzilla.xamarin.com/show_bug.cgi?id=36287 and turned off ProGuard for Release config

Steps to Reproduce

  1. Create Xamarin Forms project
  2. Update all packages to the latest version
  3. Turn on Proguard in Release Config
  4. Build in Release and deploy to physical device

Expected Behavior

Not crash on boot

Actual Behavior

Crash on boot

Basic Information

  • Version with issue: Xamarin.Android.Support.* 27.0.2
  • Last known good version: Xamarin.Android.Support.* 26.1.0.1
  • IDE: VS for Mac 7.4.3 (build 10) Stable Channel
  • Platform Target Frameworks:
    • iOS:
    • Android: target API Level 27
    • UWP:
  • Android Support Library Version:
  • Nuget Packages: Xamarin.Forms 2.5.0.280555
  • Affected Devices: all Android versions

Screenshots

Reproduction Link

@motoko89 motoko89 changed the title Xamarin Forms Android app crash on boot in Release config with ProGuard on Xamarin Forms Android app crash on boot in Release config with ProGuard on after updated to 27.0.2 Apr 18, 2018
@PureWeen
Copy link
Contributor

Can you try some of the suggestions I made in this thread

#2457

I have a couple projects running with 27.0.2 and they aren't having any issues

@motoko89
Copy link
Author

motoko89 commented Apr 18, 2018

@PureWeen thanks! I will try it out

Currently my ProGuard.cfg only has the first 2 lines, let me add the rest:

-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

@samhouts samhouts added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Apr 18, 2018
@PureWeen
Copy link
Contributor

PureWeen commented Apr 18, 2018

from @jonathanpeppers

I bet Xamarin.Forms needs to ship something like: -keep class android.support.v7.widget.** { public *; } making sure we only include as little as needed

From this thread #2495

It looks like

-keep class android.support.v7.widget.FitWindowsFrameLayout { *; }
-dontwarn android.support.v7.widget.FitWindowsFrameLayout

Was enough to resolve the issue

@PureWeen
Copy link
Contributor

Closing this issue for now. Please comment if you are still having issues and Proguard didn't resolve

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue.
Projects
None yet
Development

No branches or pull requests

3 participants