We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project build error Avalonia for android (XAPRAS7000 System.BadImageFormatException: Invalid number of sections declared in PE header)
Create an Avalonia project using the wizard (Visual Studio 2022)
Install the latest packages
Call the project build
Result
Rebuild started at 21:23... Restored W:\MyProjects\AvaloniaApplication1\AvaloniaApplication1\AvaloniaApplication1.csproj (in 52 ms). Restored W:\MyProjects\AvaloniaApplication1\AvaloniaApplication1.Android\AvaloniaApplication1.Android.csproj (in 110 ms). Restored W:\MyProjects\AvaloniaApplication1\MauiApp1\MauiApp1.csproj (in 381 ms). 1>------ Rebuild All started: Project: AvaloniaApplication1, Configuration: Debug Any CPU ------ 1>AvaloniaApplication1 -> W:\MyProjects\AvaloniaApplication1\AvaloniaApplication1\bin\Debug\net7.0\AvaloniaApplication1.dll 2>------ Rebuild All started: Project: AvaloniaApplication1.Android, Configuration: Debug Any CPU ------ 2>AvaloniaApplication1.Android -> W:\MyProjects\AvaloniaApplication1\AvaloniaApplication1.Android\bin\Debug\net7.0-android\AvaloniaApplication1.Android.dll 2>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.AssemblyResolution.targets(107,5): error XAPRAS7000: System.BadImageFormatException: Invalid number of sections in declared in PE header. 2>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.AssemblyResolution.targets(107,5): error XAPRAS7000: at System.Reflection.PortableExecutable.PEHeaders.ReadSectionHeaders(PEBinaryReader& reader) 2>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.AssemblyResolution.targets(107,5): error XAPRAS7000: at System.Reflection.PortableExecutable.PEHeaders..ctor(Stream peStream, Int32 size, Boolean isLoadedImage) 2>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.AssemblyResolution.targets(107,5): error XAPRAS7000: at System.Reflection.PortableExecutable.PEReader.InitializePEHeaders() 2>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.AssemblyResolution.targets(107,5): error XAPRAS7000: at System.Reflection.PortableExecutable.PEReader.GetMetadataBlock() 2>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.AssemblyResolution.targets(107,5): error XAPRAS7000: at System.Reflection.Metadata.PEReaderExtensions.GetMetadataReader(PEReader peReader, MetadataReaderOptions options, MetadataStringDecoder utf8Decoder) 2>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.AssemblyResolution.targets(107,5): error XAPRAS7000: at Xamarin.Android.Tasks.ProcessAssemblies.DeduplicateAssemblies(List`1 output, Dictionary`2 symbols) 2>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.AssemblyResolution.targets(107,5): error XAPRAS7000: at Xamarin.Android.Tasks.ProcessAssemblies.RunTask() 2>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.AssemblyResolution.targets(107,5): error XAPRAS7000: at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 2>Done building project "AvaloniaApplication1.Android.csproj" -- FAILED. ========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ========== ========== Rebuild completed at 21:23 and took 06,527 seconds ==========
Similar problem on all versions net7.0-android and net8.0-android
The build machine has all the necessary dependencies installed
Correct build of the project without errors
11.0.10
Android
No response
The text was updated successfully, but these errors were encountered:
can you try 11.1 beta?
Sorry, something went wrong.
Problem still exists =(
Maybe someone has encountered a similar error?
can you upload a very minimal sample for me to double-check? Is it a real world device or an emulator?
No branches or pull requests
Describe the bug
Project build error Avalonia for android (XAPRAS7000 System.BadImageFormatException: Invalid number of sections declared in PE header)
To Reproduce
Create an Avalonia project using the wizard (Visual Studio 2022)
Install the latest packages
Call the project build
Result
Similar problem on all versions
net7.0-android and net8.0-android
The build machine has all the necessary dependencies installed
Expected behavior
Correct build of the project without errors
Avalonia version
11.0.10
OS
Android
Additional context
No response
The text was updated successfully, but these errors were encountered: