Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xamarin.Forms' Android doesn't compile with R8/ProGuard active in Release mode #58

Closed
agharium opened this issue Nov 5, 2019 · 6 comments
Assignees
Labels
Android Android only issue bug Something isn't working

Comments

@agharium
Copy link

agharium commented Nov 5, 2019

Describe the bug
Xamarin.Forms' Android doesn't compile with R8/ProGuard active in Release mode.

To Reproduce
Steps to reproduce the behavior:

  1. Activate R8/ProGuard with plugin installed and try to compile.

Expected behavior
Successful compilation.

Platform:

  • OS: Windows 10
  • Visual Studio 2019

Smartphone:

  • Device: Tested on Emulator and Samsung A5 2017
  • OS: Android
  • Version 9.0 and 8.0, respectively

Additional context
Error when R8 active: Compilation can't be completed because some library classes are missing.
Error when ProGuard active: "java.exe" exited with code 1

It builds normally when no code reducer is selected.
Haven't tested on Debug mode (where code reducer is useless).

@agharium agharium added the bug Something isn't working label Nov 5, 2019
@thudugala
Copy link
Owner

Please attach a sample project

@thudugala
Copy link
Owner

@agharium
Copy link
Author

agharium commented Nov 6, 2019

Sample

Also, I noticed that on Android Oreo, the icon doesn't get any color (not even the gray when no color is set). Any idea why? I've only been testing on Android 8 and 9.

Check this out:

Android 9 Pie:
screenshot-2019-11-06_11 52 56 913

Android 8 Oreo:
WhatsApp Image 2019-11-06 at 12 52 27

As I know, this color feature was added on API 21, right? Not sure though.. Also, the icon file is exactly the same on both.

This could be a thing on my physical device.. it's a Samsung A5 2017 with the brand modified Android system and things..

And, by the way, thanks for the plugin, it's pretty good. I've been testing and if everything runs smooth, I'll use it on production.

@GitBOUF
Copy link
Contributor

GitBOUF commented Mar 18, 2020

HI! Does anyone has a solution or a workaround for this problem? Getting the same error in release mode, with code shrinker set to R8 and with Plugin.LocalNotification version 5.0.0 or 5.0.1.
More specifically, the following class is missing: androidx.paging.PositionalDataSource

EDIT: Only way I've found to compile was by adding the following to proguard.cfg:
-keep class androidx.paging.PositionalDataSource { *; }
-dontwarn androidx.paging.PositionalDataSource
But it crashes the app instantly on launch, so not a workaround sadly

@thudugala
Copy link
Owner

@GitBOUF please add comment to issue #72

@thudugala
Copy link
Owner

Has a solution in #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android only issue bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants