Xamarin 的多目标库

问题描述

我正在尝试为 Xamarin(Android、IOS 和 UWP)创建一个多目标库。我检查了一些多目标 xamarin 库的项目文件。 (例如Rg.Plugins.Popup、Xamarin.Essentials、MvvmCross)并像这样编辑我的库(XamTemel.Ortak)的csproj文件

<Project Sdk="MSBuild.Sdk.Extras/3.0.22">
   <PropertyGroup>
     <TargetFrameworks>netstandard2.0;Xamarin.iOS10;monoAndroid10.0;</TargetFrameworks>
     <TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.17763;</TargetFrameworks>
     <DebugType>portable</DebugType>
     <Configurations>Debug;Release</Configurations>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
     <DebugSymbols>true</DebugSymbols>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' ">
     <!-- sourcelink: Declare that the Repository URL can be published to NuSpec -->
     <PublishRepositoryUrl>true</PublishRepositoryUrl>
     <!-- sourcelink: Embed source files that are not tracked by the source control manager to the PDB -->
     <EmbedUntrackedSources>true</EmbedUntrackedSources>
     <!-- sourcelink: Include PDB in the built .nupkg -->
     <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
   </PropertyGroup>
   <ItemGroup>
     <Compile Remove="Platforms\**\*.cs" />
     <None Include="Platforms\**\*.cs" />
   </ItemGroup>
   <ItemGroup Condition=" $(TargetFramework.StartsWith('monoandroid')) ">
     <None Remove="Platforms\Android\**\*.cs" />
     <None Remove="Platforms\Xamarin\**\*.cs" />
     <Compile Include="Platforms\Android\**\*.cs" />
     <Compile Include="Platforms\Xamarin\**\*.cs" />
     <AndroidResource Include="Resources\**\*.xml" SubType="Designer" Generator="MSBuild:UpdateAndroidResources" />
     <AndroidResource Include="Resources\**\*.json" Generator="MSBuild:UpdateAndroidResources" />
   </ItemGroup>
    
   <ItemGroup>
     <packagereference Include="ColorPicker.Xamarin.Forms" Version="1.3.4.11" />
   </ItemGroup>
    
    
 </Project>

正如你所看到的,我将把平台渲染器放在 Platform/Android-IOS-UWP 等中。这在 Android 上不能正常工作。但是 ColorPicker 库在 UWP 上给了我这个错误

enter image description here

我不明白为什么它找不到 ColorPicker。版本号好像没问题。我做错了什么?

这是示例解决方案。

https://drive.google.com/file/d/1PnqFyzDmTBom6GH9YVdbyBvNwikitYlC/view?usp=sharing

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)