android - Visual Studio 中的 Xamarin 打包失败 |单符号错误 -1073740791

标签 android xamarin xamarin.android packaging

尝试打包我的 Xamarin Android 应用程序时出现以下错误。该应用程序在我的手机上以 Debug模式完美运行,现在我只是尝试生成 APK,但我收到此错误消息:

Archiving App Bundle 'PoolHeatingClient'...
Creating archive directory 'PoolHeatingClient'...
Creating directory 'C:\Users\entro\AppData\Local\Xamarin\Mono for Android\Archives\2016-10-29\PoolHeatingClient 10-29-16 4.21 PM.apkarchive'...
Deleting files '*.apk'...
Packaging 'PoolHeatingClient'...

The command ""C:\Program Files (x86)\MSBuild\Xamarin\Android\mono-symbolicate" store-symbols "bin\Release\PoolHeatingClient.PoolHeatingClient.apk.mSYM" "obj\Release\android/assets"" exited with code -1073740791.


Failed to create App archive 'PoolHeatingClient'.

我不知道从哪里开始... 谢谢, 米歇尔

这是我的 .csproj 文件:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{43716C55-E6A1-4F1D-8E2E-947AD36C37E3}</ProjectGuid>
    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>PoolHeatingClient</RootNamespace>
    <AssemblyName>PoolHeatingClient</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <AndroidApplication>true</AndroidApplication>
    <AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
    <AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
    <TargetFrameworkVersion>v7.0</TargetFrameworkVersion>
    <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>True</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
    <AndroidLinkMode>Full</AndroidLinkMode>
    <EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
    <BundleAssemblies>False</BundleAssemblies>
    <AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
    <Debugger>Xamarin</Debugger>
    <AotAssemblies>False</AotAssemblies>
    <EnableLLVM>False</EnableLLVM>
    <AndroidEnableMultiDex>False</AndroidEnableMultiDex>
    <EnableProguard>False</EnableProguard>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <DebugSymbols>False</DebugSymbols>
    <AndroidManagedSymbols>true</AndroidManagedSymbols>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
    <AndroidLinkMode>Full</AndroidLinkMode>
    <EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
    <BundleAssemblies>False</BundleAssemblies>
    <AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
    <Debugger>Xamarin</Debugger>
    <AotAssemblies>False</AotAssemblies>
    <EnableLLVM>False</EnableLLVM>
    <AndroidEnableMultiDex>False</AndroidEnableMultiDex>
    <EnableProguard>False</EnableProguard>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Mono.Android" />
    <Reference Include="mscorlib" />
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Class1.cs" />
    <Compile Include="MainActivity.cs" />
    <Compile Include="Resources\Resource.Designer.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="GettingStarted.Xamarin" />
    <None Include="Resources\AboutResources.txt" />
    <None Include="Assets\AboutAssets.txt" />
  </ItemGroup>
  <ItemGroup>
    <AndroidResource Include="Resources\layout\Main.axml">
      <SubType>Designer</SubType>
    </AndroidResource>
  </ItemGroup>
  <ItemGroup>
    <AndroidResource Include="Resources\values\Strings.xml" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Properties\AndroidManifest.xml">
      <SubType>Designer</SubType>
    </None>
  </ItemGroup>
  <ItemGroup>
    <AndroidResource Include="Resources\drawable\icon.png" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Resources\drawable-hdpi\" />
    <Folder Include="Resources\drawable-ldpi\" />
    <Folder Include="Resources\drawable-mdpi\" />
    <Folder Include="Resources\drawable-xhdpi\" />
    <Folder Include="Resources\drawable-xxhdpi\" />
    <Folder Include="Resources\drawable-xxxhdpi\" />
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
     Other similar extension points exist, see Microsoft.Common.targets.
        <Target Name="BeforeBuild">
        </Target>
        <Target Name="AfterBuild">
        </Target>
 -->
</Project>

最佳答案

遗憾的是,这是当前稳定版中的一个错误。这里有一个关于此问题的错误报告:

https://bugzilla.xamarin.com/show_bug.cgi?id=46164

但是根据我的观察,您可以通过以下方式直接更新到 Beta channel 来解决此问题:

Tools -> Options -> Xamarin -> Other -> Switch to Beta -> Check for Updates

https://bugzilla.xamarin.com/show_bug.cgi?id=46164#c9

我还在这里添加了一个解决方法:

https://bugzilla.xamarin.com/show_bug.cgi?id=46164#c14

您需要将以下内容添加到您的 Release当前稳定版本中的配置:

<AndroidManagedSymbols>False</AndroidManagedSymbols>

关于android - Visual Studio 中的 Xamarin 打包失败 |单符号错误 -1073740791,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40320084/

相关文章:

c# - 根据 Xamarin IOS 中的文本大小调整标签

c# - Xamarin Android 构建失败 "Invalid value for outputAssembly"

c# - 在 Monodroid 中使用 Java 类文件

xamarin - 无法从程序集中加载 "Xamarin.Build.Download.XamarinBuildAndroidAarProguardConfigs"任务

C# 异步方法在 Activity 暂停时继续,导致 IllegalStateException : Can not perform this action after onSaveInstanceState

android - ArrayAdapter 上的 ViewHolder 缓存模式具有链式 react

android - 在 Bundle 中重新启动 Activity 时保存 GoogleApiClient

android - 修复了可见的标签/点 TabLayout android

c# - 缺少方法 UnityEngine.VR.VRSettings.get_enabled |未处理 Unity IAP 购买 |安卓

c# - Xamarin 可以处理 Android 上的振动加速度计吗?