gpt4 book ai didi

xamarin - 新建一个Mobile.App(Xamarin.Forms)项目,尝试编译,但是 "Failed linking references"

转载 作者:行者123 更新时间:2023-12-04 23:12:01 24 4
gpt4 key购买 nike

我安装了最新的 Visual Studio 2019 (16.2.3) 社区版和 Xamarin。

当我使用 Mobile App (Xamarin.Forms) 创建全新的解决方案时模板并选择 Android,我无法在任何配置中构建它。

最终得到以下输出:

1>"C:\Users\myuser\source\repos\App3\App3\App3.Android\App3.Android.csproj" (Build;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies target) (1) ->
1>(_UpdateAndroidResgen target) ->
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1697,2): error APT0000: resource style/Theme.AppCompat.Light.Dialog (aka com.companyname.app3:style/Theme.AppCompat.Light.Dialog) not found.
1> C:\Users\myuser\source\repos\App3\App3\App3.Android\Resources\values\styles.xml(4): error APT0000: style attribute 'attr/colorAccent (aka com.companyname.app3:attr/colorAccent)' not found.
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1697,2): error APT0000: resource style/Theme.AppCompat.Light.DarkActionBar (aka com.companyname.app3:style/Theme.AppCompat.Light.DarkActionBar) not found.
1> C:\Users\myuser\source\repos\App3\App3\App3.Android\Resources\values\styles.xml(2): error APT0000: style attribute 'attr/windowNoTitle (aka com.companyname.app3:attr/windowNoTitle)' not found.
1> C:\Users\myuser\source\repos\App3\App3\App3.Android\Resources\values\styles.xml(2): error APT0000: style attribute 'attr/windowActionBar (aka com.companyname.app3:attr/windowActionBar)' not found.
1> C:\Users\myuser\source\repos\App3\App3\App3.Android\Resources\values\styles.xml(2): error APT0000: style attribute 'attr/colorPrimary (aka com.companyname.app3:attr/colorPrimary)' not found.
1> C:\Users\myuser\source\repos\App3\App3\App3.Android\Resources\values\styles.xml(2): error APT0000: style attribute 'attr/colorPrimaryDark (aka com.companyname.app3:attr/colorPrimaryDark)' not found.
1> C:\Users\myuser\source\repos\App3\App3\App3.Android\Resources\values\styles.xml(3): error APT0000: style attribute 'attr/colorAccent (aka com.companyname.app3:attr/colorAccent)' not found.
1> C:\Users\myuser\source\repos\App3\App3\App3.Android\Resources\values\styles.xml(4): error APT0000: style attribute 'attr/windowActionModeOverlay (aka com.companyname.app3:attr/windowActionModeOverlay)' not found.
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1697,2): error APT0000: failed linking references.

App3.Android.csproj中引用的包如下:

    <PackageReference Include="Xamarin.Forms" Version="4.1.0.555618" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />

最低 Android 版本为 Android 5.0 (API Level 21 - Lollipop)
目标安卓版本为 Android 9.0 (API Level 28 - Pie)

最佳答案

无论出于何种原因,它都可以将自己锁定在此状态。

删除 *\bin & *\obj解决了这个问题。

关于xamarin - 新建一个Mobile.App(Xamarin.Forms)项目,尝试编译,但是 "Failed linking references",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57592847/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com