我想利用火基云层的图像实施一个非常简单的推动通知系统。
MAUI项目以8版网络为基础。
I ve subsequently :this Guide for establishing the Project up。
当指南使用时,net6
So my .csproj file looks like this :
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>PushNotificationsTest</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Display name -->
<ApplicationTitle>PushNotificationsTest</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.companyname.pushnotificationstest</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier( $(TargetFramework) )) == ios ">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier( $(TargetFramework) )) == android ">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier( $(TargetFramework) )) == tizen ">6.5</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="ResourcesAppIconappicon.svg" ForegroundFile="ResourcesAppIconappiconfg.svg" Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen Include="ResourcesSplashsplash.svg" Color="#512BD4" BaseSize="128,128" />
<!-- Images -->
<MauiImage Include="ResourcesImages*" />
<MauiImage Update="ResourcesImagesdotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts -->
<MauiFont Include="ResourcesFonts*" />
<!-- Raw Assets (also remove the "ResourcesRaw" prefix) -->
<MauiAsset Include="ResourcesRaw**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework) == net8.0-android ">
<GoogleServicesJson Include="google-services.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-rc.1.23419.4" />
<PackageReference Include="Plugin.Firebase" Version="2.0.7" />
<PackageReference Include="Plugin.FirebaseCrashlytics" Version="4.1.0" />
</ItemGroup>
<!-- Build Properties must be defined within these property groups to ensure successful publishing
to the Mac App Store. See: https://aka.ms/maui-publish-app-store#define-build-properties-in-your-project-file -->
<PropertyGroup Condition="$(TargetFramework.Contains( -maccatalyst )) and $(Configuration) == Debug ">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Debug.plist</CodesignEntitlements>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains( -maccatalyst )) and $(Configuration) == Release ">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Release.plist</CodesignEntitlements>
<UseHardenedRuntime>true</UseHardenedRuntime>
</PropertyGroup>
</Project>
但是,当我想管理申请时,我有以下例外:
Error JAVA0000 java.exe: Error in C:Usersmdavidovic.nugetpackagesxamarin.androidx.collection.jvm1.3.0.1uildTransitive
et6.0-android31.0....jarandroidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class:
Type androidx.collection.ArraySetKt is defined multiple times: C:Usersmdavidovic.nugetpackagesxamarin.androidx.collection.jvm1.3.0.1uildTransitive
et6.0-android31.0....jarandroidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class, C:Usersmdavidovic.nugetpackagesxamarin.androidx.collection.ktx1.2.0.9uildTransitive
et6.0-android31.0....jarandroidx.collection.collection-ktx.jar:androidx/collection/ArraySetKt.class
Compilation failed
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:Usersmdavidovic.nugetpackagesxamarin.androidx.collection.jvm1.3.0.1uildTransitive
et6.0-android31.0....jarandroidx.collection.collection-jvm.jar
androidx/collection/ArraySetKt.class
at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:126)
at com.android.tools.r8.D8.main(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:5)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:Usersmdavidovic.nugetpackagesxamarin.androidx.collection.jvm1.3.0.1uildTransitive
et6.0-android31.0....jarandroidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class
at Version.fakeStackEntry(Version_8.1.56.java:0)
at com.android.tools.r8.M.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:5)
at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:81)
at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:32)
at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:31)
at com.android.tools.r8.utils.R0.b(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:2)
at com.android.tools.r8.D8.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:26)
at com.android.tools.r8.D8.b(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:13)
at com.android.tools.r8.D8.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:24)
at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:113)
... 1 more
Caused by: com.android.tools.r8.utils.b: Type androidx.collection.ArraySetKt is defined multiple times: C:Usersmdavidovic.nugetpackagesxamarin.androidx.collection.jvm1.3.0.1uildTransitive
et6.0-android31.0....jarandroidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class, C:Usersmdavidovic.nugetpackagesxamarin.androidx.collection.ktx1.2.0.9uildTransitive
et6.0-android31.0....jarandroidx.collection.collection-ktx.jar:androidx/collection/ArraySetKt.class
at com.android.tools.r8.utils.O2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:21)
at com.android.tools.r8.utils.O2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:26)
at com.android.tools.r8.utils.A2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:44)
at com.android.tools.r8.utils.A2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:10)
at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
at com.android.tools.r8.utils.A2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:6)
at com.android.tools.r8.graph.b4$a.e(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:7)
at com.android.tools.r8.dex.c.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:58)
at com.android.tools.r8.dex.c.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:9)
at com.android.tools.r8.dex.c.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:8)
at com.android.tools.r8.D8.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:29)
at com.android.tools.r8.D8.d(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:17)
at com.android.tools.r8.D8.c(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:1)
at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:28)
... 6 more
0>------- Finished building project: PushNotificationsTest. Succeeded: False. Errors: 1. Warnings: 3
我一直在寻找解决办法,但我没有看到任何人使用MAUI。 NET 8用于推动通知书。
谁能帮助我?
页: 1
我将这部法典从.csproj档案中删除,因为错误与它相同或没有:
<ItemGroup Condition=" $(TargetFramework) == net6.0-android ">
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk7" Version="1.7.10" ExcludeAssets="build;buildTransitive" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.7.10" ExcludeAssets="build;buildTransitive" />
</ItemGroup>
我尝试删除双眼和切片,清理整个解决办法,但似乎没有帮助。
I ve还试图在上通过@moljac安装“Xamarin.AndroidX.Fragment.Ktx” nuget ,但错误是相同的......