Xamarin Android Build Fails with AndroidLinkTool - R8

If I enable Android Link tool & Android Dex tool the build fails in Xamarin Android.

In my app I enabled these two configurations

<AndroidLinkTool>r8</AndroidLinkTool>
<AndroidDexTool>d8</AndroidDexTool>

After enabling that I am getting the below error.

Build FAILED.

obj/Release/android/AndroidManifest.xml : warning XA4218: Unable to find //manifest/application/uses-library at path: /Users/sooraj/Library/Developer/Xamarin/android-sdk-macosx/platforms/android-28/optional/com.symbol.emdk.jar
R8 : warning : Missing class: com.symbol.emdk.barcode.BarcodeManager$ScannerConnectionListener
R8 : warning : Missing class: com.symbol.emdk.barcode.Scanner$DataListener
R8 : warning : Missing class: com.symbol.emdk.simulscan.SimulScanReader$StatusListerner
R8 : warning : Missing class: com.symbol.emdk.EMDKManager$StatusListener
R8 : warning : Missing class: com.symbol.emdk.barcode.Scanner$StatusListener
R8 : warning : Missing class: com.symbol.emdk.EMDKManager$EMDKListener
R8 : warning : Missing class: com.symbol.emdk.scanandpair.ScanAndPairManager$StatusListener
R8 : warning : Missing class: com.symbol.emdk.ProfileManager$DataListener
R8 : warning : Missing class: com.symbol.emdk.simulscan.SimulScanReader$DataListerner
R8 : error : Compilation can't be completed because some library classes are missing.
10 Warning(s)
1 Error(s)

Time Elapsed 00:00:03.67

Unable to find //manifest/application/uses-library at path: /Users/sooraj/Library/Developer/Xamarin/android-sdk-macosx/platforms/android-28/optional/com.symbol.emdk.jar

Since I am targeting my app in both Zebra and Other consumer devices I am using this line of code in manifest.

<uses-library android:name="com.symbol.emdk" android:required="false" />

Could you please help

Alexander Palchikov
Have you installed EMDK?

Hello.

Have you installed EMDK?
As far as I understand EMDK is not installed or is installed incorrectly.
http://techdocs.zebra.com/emdk-for-xamarin/5-0/guide/nuget/

Alexander Palchikov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ewan Paterson
Same Issue Here

Exactly the same issue here. Using the Symbol.XamarinEMDK Nuget package (version 4.0.0.3). Building with Visual Studio Enterprise 16.2.3 on Windows 10.

As far as I am aware, there is no option to "install" EMDK for Xamarin beyond installing the Nuget package, am I correct?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexander Palchikov
Hello.

Hello.

Yes, you are correct.
You have to use Nuget package to install EMDK for Xamarin.
http://techdocs.zebra.com/emdk-for-xamarin/5-0/guide/nuget/

Alexander Palchikov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ewan Paterson
Same Issue Here

OK, thanks for your reply, that is already installed.

This is a scenario that occurs when using d8 and r8 when linking and dexing a Xamarin.Android project. Compiling without these options set works fine. Because the permission is set in the Android Manifest, r8 looks for the EMDK libraries in the default Android SDK location, and they're obviously not there.

This should be fixed ASAP as d8 and r8 are the new standards for building Android and Xamarin.Android projects, so newcomers (and existing projects which upgrade) will likely run into this problem immediately.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ewan Paterson
Update

Hi Alexander,

Do you have any updates on this issue? Is it being worked on?

Thanks,

Ewan

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments