xamarin-fingerprint icon indicating copy to clipboard operation
xamarin-fingerprint copied to clipboard

Cannot Install Release version of Android app with Linking enabled

Open gordonsaxby opened this issue 3 years ago • 6 comments

Steps to reproduce

  1. Add xamarin-fingerprint to a Visual Studio 2019 project, add setup code

  2. Set Release config of Visual Studio project to "Linking = SDK Assemblies Only"

  3. Compile and deploy to an Android device.

Expected behavior

It should compile and deploy successfully to the Android device

Actual behavior

Build succeeds but installation fails (message "Installation of the app failed.")

Crashlog

If something causes an exception paste full stack trace + Exception here

Configuration

Development Environment: Visual Studio 2019 on Windows "Use incremental Android packaging system" ticked Android Package Format = "bundle" Dex compiler = "d8"

Version of the Plugin: 2.1.4

Platform: Android version 10

Device: Nokia 3.4 (testing device but happens on another device too)

I am not using "Code Shrinker" (r8 or ProGuard), I am using Linker setting of "Sdk Assemblies Only" not "Sdk and User Assemblies", so the suggestion here does not apply https://github.com/smstuebe/xamarin-fingerprint#android-code-shrinker-proguard--r8.

I have to set Linker = None in order for the Installation to work. Of course, that means the app will be bigger than it should be.

gordonsaxby avatar Aug 24 '21 14:08 gordonsaxby

Hi @gordonsaxby,

I'm the friendly issue checker. Thanks for using the issue template :star2: I appreciate it very much. I'm sure, the maintainers of this repository will answer, soon.

smsissuechecker avatar Aug 24 '21 14:08 smsissuechecker

Can anyone help with this (rather key) issue?

gordonsaxby avatar Sep 06 '21 15:09 gordonsaxby

same problem with me, proguard now obsolete, trying to use r8 and d8 with ' sdk assemblies only' option but can't run on emulator or real device. crashes on immediate start of app.

Rishantkr avatar Sep 08 '21 15:09 Rishantkr

Some sort of official comment at least, if not a solution, would be appreciated to acknowledge the issue.

gordonsaxby avatar Oct 04 '21 08:10 gordonsaxby

@gordonsaxby can you provide logs? If the installation fails, there should be a reason (VS output, android system logs, adb logs)

smstuebe avatar Oct 04 '21 16:10 smstuebe

@gordonsaxby can you provide logs? If the installation fails, there should be a reason (VS output, android system logs, adb logs)

It appears that the installation failure was because the installed version was compiled in debug mode. I removed the app from the device and then the installation worked.

However, the problem still exists - if I enable Linking = "Sdk Assemblies Only" the app starts (splash screen shows) and then crashes. The app uses "App Center" to record crashes but nothing is logged, so it can't be getting to "OnStart" which is where the AppCenter initialisation takes place.

I have a proguard.cfg file as recommended but it does not appear to help.

I have tried using "LogCat" in Visual Studio but I do not understand it enough to extract anything useful!

My settings are:

image

gordonsaxby avatar Oct 06 '21 12:10 gordonsaxby