Error when compiling if the Symbol.XamarinEMDK nuget is installed in more than two projects

Y Yanis Dalabiras 2 years 2 months ago
3 0 0

I have a library called "Sample.Plugin" in which I have installed the nuget Symbol.XamarinEMDK with version 8.0.0.2 is a library that I use to obtain the serial of Zebra devices, so far everything is correct, the problem I have is that when I install my "Sample.Plugin" library in a Xamarin.Forms (Android) project in which I also have the Symbol.XamarinEMDK nuget installed with version 8.0.0.2 (the same version of Symbol.XamarinEMDK that is installed in the "Sample. Plugin") then a series of errors occurs that imply that there is a clash between the 2 Symbol.XamarinEMDK.

Removing the Symbol.XamarinEMDK nuget from my Xamarin.Forms (Android) project everything compiles fine, but I need the Symbol.XamarinEMDK to be installed both in my Xamarin.Forms (Android) project and in my Sample.Plugin library, but it seems that if it is installed in the 2 projects collide with each other, any suggestions why this happens?

And shows the following errors:
<code>
2&gt;MSBUILD : java.exe error JAVA0000: Info in obj\Debug\100\lp\1\jl\__reference__api3lib.jar:com/zebra/scannercontrol/SDKHandler.class:
2&gt;MSBUILD : java.exe error JAVA0000: Malformed inner-class attribute:
2&gt;MSBUILD : java.exe error JAVA0000: outerTypeInternal: com/zebra/scannercontrol/R
2&gt;MSBUILD : java.exe error JAVA0000: innerTypeInternal: com/zebra/rfid/api3/R$string
2&gt;MSBUILD : java.exe error JAVA0000: innerName: string
2&gt;MSBUILD : java.exe error JAVA0000:
2&gt;MSBUILD : java.exe error JAVA0000: Error in obj\Debug\100\lp\1\jl\__reference__classes.jar:com/symbol/emdk/EMDKBase.class:
2&gt;MSBUILD : java.exe error JAVA0000: Type com.symbol.emdk.EMDKBase is defined multiple times: obj\Debug\100\lp\1\jl\__reference__classes.jar:com/symbol/emdk/EMDKBase.class, obj\Debug\100\lp\6\jl\com.symbol.emdk.jar:com/symbol/emdk/EMDKBase.class
2&gt;MSBUILD : java.exe error JAVA0000: Compilation failed
2&gt;MSBUILD : java.exe error JAVA0000: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\100\lp\1\jl\__reference__classes.jar
2&gt;MSBUILD : java.exe error JAVA0000: com/symbol/emdk/EMDKBase.class
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:98)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.main(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
2&gt;MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\100\lp\1\jl\__reference__classes.jar:com/symbol/emdk/EMDKBase.class
2&gt;MSBUILD : java.exe error JAVA0000: at Version.fakeStackEntry(Version_3.3.28.java:0)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:75)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:28)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:27)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.Bj.b(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:2)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:22)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:17)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:85)
2&gt;MSBUILD : java.exe error JAVA0000: ... 1 more
2&gt;MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.internal.f: Type com.symbol.emdk.EMDKBase is defined multiple times: obj\Debug\100\lp\1\jl\__reference__classes.jar:com/symbol/emdk/EMDKBase.class, obj\Debug\100\lp\6\jl\com.symbol.emdk.jar:com/symbol/emdk/EMDKBase.class
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:14)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.DT.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:22)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:33)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:10)
2&gt;MSBUILD : java.exe error JAVA0000: at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.CN.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:6)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.graph.B2$a.e(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:4)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.dex.b.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:105)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.dex.b.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:28)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:25)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.d(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:606)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.c(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:1)
2&gt;MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.internal.Bj.a(R8_3.3.28_2aaf796388b4e9f6bed752d926eca110512a53a3f09a8d755196089c1cfdf799:24)
2&gt;MSBUILD : java.exe error JAVA0000: ... 5 more
2&gt;MSBUILD : java.exe error JAVA0000: Directory 'obj\Debug\100\lp\1' is from 'Sample. Plugin.Core.dll'.
</code>

CONTACT
Can’t find what you’re looking for?