Closed Auto72 closed 5 months ago
I tried to include the following in the project file, but it doesn't work.
<!-- Should match version of the referenced 'Xamarin.AndroidX.Collection' package -->
<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.4.0.4" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.4" />
Now I get the following error:
Rebuild started at 10:52... 1>------ Rebuild All started: Project: MauiApp2, Configuration: Debug Any CPU ------ Restored D:\GitHub\MauiApp2\MauiApp2\MauiApp2.csproj (in 730 ms). 1>MauiApp2 -> D:\GitHub\MauiApp2\MauiApp2\bin\Debug\net8.0-ios\iossimulator-x64\MauiApp2.dll 1>MauiApp2 -> D:\GitHub\MauiApp2\MauiApp2\bin\Debug\net8.0-maccatalyst\maccatalyst-x64\MauiApp2.dll 1>MauiApp2 -> D:\GitHub\MauiApp2\MauiApp2\bin\Debug\net8.0-android\MauiApp2.dll 1>MauiApp2 -> D:\GitHub\MauiApp2\MauiApp2\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\MauiApp2.dll 1>MSBUILD : java.exe error JAVA0000: Error in obj\Debug\net8.0-android\lp\110\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class: 1>MSBUILD : java.exe error JAVA0000: Type androidx.activity.ActivityViewModelLazyKt$viewModels$1 is defined multiple times: obj\Debug\net8.0-android\lp\110\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class, obj\Debug\net8.0-android\lp\143\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class 1>MSBUILD : java.exe error JAVA0000: Compilation failed 1>MSBUILD : java.exe error JAVA0000: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net8.0-android\lp\110\jl\classes.jar 1>MSBUILD : java.exe error JAVA0000: androidx/activity/ActivityViewModelLazyKt$viewModels$1.class 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:135) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.main(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5) 1>MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\net8.0-android\lp\110\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class 1>MSBUILD : java.exe error JAVA0000: at Version.fakeStackEntry(Version_8.2.33.java:0) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.T.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:82) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:32) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:31) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:2) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:42) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:13) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:40) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:122) 1>MSBUILD : java.exe error JAVA0000: ... 1 more 1>MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.utils.b: Type androidx.activity.ActivityViewModelLazyKt$viewModels$1 is defined multiple times: obj\Debug\net8.0-android\lp\110\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class, obj\Debug\net8.0-android\lp\143\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.Q2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:21) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:54) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:10) 1>MSBUILD : java.exe error JAVA0000: at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.graph.m4$a.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:61) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:12) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:9) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:45) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:17) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.c(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:69) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:28) 1>MSBUILD : java.exe error JAVA0000: ... 6 more 1>MSBUILD : java.exe error JAVA0000: Directory 'obj\Debug\net8.0-android\lp\110' is from 'androidx.activity.activity.aar'. 1>Done building project "MauiApp2.csproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== ========== Rebuild completed at 10:53 and took 26.991 seconds ==========
No solution yet to use Google Android Play Integrity from .NET MAUI?🤔
This works for me:
<PackageReference Include="Xamarin.Google.Android.Play.Integrity" Version="1.3.0.3" />
<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.4.0.4" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.4" />
<PackageReference Include="Xamarin.AndroidX.Activity" Version="1.9.0.3" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.9.0.3" />
Now the project builds. Thanks!
I created a .NET MAUI (net8.0) using the current version of Microsoft.Maui.Controls (8.0.60).
I added the following NuGet package: "Xamarin.Google.Android.Play.Integrity" (version: 1.3.0.3)
https://www.nuget.org/packages/Xamarin.Google.Android.Play.Integrity/
I tried to implement a Google Play Integrity example, but when I build the solution, I get the following error:
Rebuild started at 18:13... 1>------ Rebuild All started: Project: MauiApp2, Configuration: Debug Any CPU ------ Restored D:\GitHub\MauiApp2\MauiApp2\MauiApp2.csproj (in 747 ms). 1>MauiApp2 -> D:\GitHub\MauiApp2\MauiApp2\bin\Debug\net8.0-ios\iossimulator-x64\MauiApp2.dll 1>MauiApp2 -> D:\GitHub\MauiApp2\MauiApp2\bin\Debug\net8.0-maccatalyst\maccatalyst-x64\MauiApp2.dll 1>MauiApp2 -> D:\GitHub\MauiApp2\MauiApp2\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\MauiApp2.dll 1>MauiApp2 -> D:\GitHub\MauiApp2\MauiApp2\bin\Debug\net8.0-android\MauiApp2.dll 1>MSBUILD : java.exe error JAVA0000: Error in C:\Users\mconti.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.4\buildTransitive\net8.0-android34.0....\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class: 1>MSBUILD : java.exe error JAVA0000: Type androidx.collection.ArrayMapKt is defined multiple times: C:\Users\mconti.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.4\buildTransitive\net8.0-android34.0....\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, C:\Users\mconti.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0....\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class 1>MSBUILD : java.exe error JAVA0000: Compilation failed 1>MSBUILD : java.exe error JAVA0000: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\mconti.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.4\buildTransitive\net8.0-android34.0....\jar\androidx.collection.collection-jvm.jar 1>MSBUILD : java.exe error JAVA0000: androidx/collection/ArrayMapKt.class 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:135) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.main(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5) 1>MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\mconti.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.4\buildTransitive\net8.0-android34.0....\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class 1>MSBUILD : java.exe error JAVA0000: at Version.fakeStackEntry(Version_8.2.33.java:0) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.T.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:82) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:32) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:31) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:2) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:42) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:13) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:40) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:122) 1>MSBUILD : java.exe error JAVA0000: ... 1 more 1>MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.utils.b: Type androidx.collection.ArrayMapKt is defined multiple times: C:\Users\mconti.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.4\buildTransitive\net8.0-android34.0....\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, C:\Users\mconti.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0....\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.Q2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:21) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:54) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:10) 1>MSBUILD : java.exe error JAVA0000: at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.graph.m4$a.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:61) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:12) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:9) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:45) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:17) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.D8.c(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:69) 1>MSBUILD : java.exe error JAVA0000: at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:28) 1>MSBUILD : java.exe error JAVA0000: ... 6 more 1>MSBUILD : java.exe error JAVA0000: 1>Done building project "MauiApp2.csproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== ========== Rebuild completed at 18:13 and took 28.488 seconds ==========
Here the test project.
MauiApp2.zip
How can we solve this?