Skip to content
New issue

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

Getting AOT/Precompiling error when building in release mode [Android] #20602

Closed
SarthakB26 opened this issue Feb 15, 2024 · 5 comments
Closed
Labels
platform/android 🤖 s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@SarthakB26
Copy link

SarthakB26 commented Feb 15, 2024

Description

Getting bunch of below error when trying to create release build on android when AOT and Trimming is enabled.
Everything work fine in debug mode I am able to generate barcode and all.

4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarcodeDetection.dll with exit code 1.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarcodeDetection.dll
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID 892B8792-5EDD-DA43-1566-C2CC4F4B8460
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Could not load signature of Iron.BarCode.Extensions.aysidy`1+<>c[T]:pivcbt due to: Could not load file or assembly 'Clipper, Version=6.4.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Failed to load method 0x600007a from 'D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarcodeDetection.dll' due to Could not resolve signature of method Iron.BarCode.Extensions.aysidy`1+<>c[T]:pivcbt.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Run with MONO_LOG_LEVEL=debug for more information.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOT of image D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarcodeDetection.dll failed.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarCode.dll with exit code 1.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarCode.dll
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID F35CA741-19B5-06CC-177A-D9451D192725
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C

4>[IronBarcodeDetection.dll] Exec (with response file contents expanded) in D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile: MONO_PATH=D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked; MONO_ENV_OPTIONS= C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.1\Sdk\..\tools\mono-aot-cross.exe --debug --nollvm "--aot=asmwriter,temp-path=obj\Release\net8.0-android\android-arm\aot\armeabi-v7a\IronBarcodeDetection,profile-only,profile=C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile,profile=C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile,mtriple=armv7-linux-gnueabi,tool-prefix=C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\tools\binutils\bin\arm-linux-androideabi-,outfile=obj\Release\net8.0-android\android-arm\aot\IronBarcodeDetection.dll.so,temp-path=obj\Release\net8.0-android\android-arm\IronBarcodeDetection.dll.tmp,ld-name=ld,ld-flags=--no-relax -s" "obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll"
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll with exit code 1.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Failed to load method 0x600007a from 'D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll' due to Could not resolve signature of method Iron.BarCode.Extensions.aysidy`1+<>c[T]:pivcbt.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID 989A889B-B758-9E90-7469-AE37D2D43981
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Could not load signature of Iron.BarCode.Extensions.aysidy`1+<>c[T]:pivcbt due to: Could not load file or assembly 'Clipper, Version=6.4.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Run with MONO_LOG_LEVEL=debug for more information.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOT of image D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll failed.
4>[IronBarCode.dll] Exec (with response file contents expanded) in D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile: MONO_PATH=D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked; MONO_ENV_OPTIONS= C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.1\Sdk\..\tools\mono-aot-cross.exe --debug --nollvm "--aot=asmwriter,temp-path=obj\Release\net8.0-android\android-arm\aot\armeabi-v7a\IronBarCode,profile-only,profile=C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile,profile=C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile,mtriple=armv7-linux-gnueabi,tool-prefix=C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\tools\binutils\bin\arm-linux-androideabi-,outfile=obj\Release\net8.0-android\android-arm\aot\IronBarCode.dll.so,temp-path=obj\Release\net8.0-android\android-arm\IronBarCode.dll.tmp,ld-name=ld,ld-flags=--no-relax -s" "obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll"
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll with exit code 1.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Failed to load method 0x6000d1d from 'D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll' due to Could not load file or assembly 'Azure.Data.Tables, Version=12.8.2.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' or one of its dependencies..
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID 96D5F8C0-B26F-EA75-8F80-DCAB8077BC13
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Run with MONO_LOG_LEVEL=debug for more information.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOT of image D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll failed.

Couldn't find much how to resolve these types of issues.
I don't want to turn off aot and trimming for android. which is a no go for android app performance

Not sure if this is trimming related or aot

Steps to Reproduce

  1. Install nuget https://www.nuget.org/packages/BarCode
  2. Try creating release build for Android when trimming is enabled

Link to public reproduction project repository

No response

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 13,14

Did you find any workaround?

No

Relevant log output

4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarcodeDetection.dll with exit code 1.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarcodeDetection.dll
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID 892B8792-5EDD-DA43-1566-C2CC4F4B8460
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Could not load signature of Iron.BarCode.Extensions.aysidy`1+<>c[T]:pivcbt due to: Could not load file or assembly 'Clipper, Version=6.4.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Failed to load method 0x600007a from 'D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarcodeDetection.dll' due to Could not resolve signature of method Iron.BarCode.Extensions.aysidy`1+<>c[T]:pivcbt.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Run with MONO_LOG_LEVEL=debug for more information.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOT of image D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarcodeDetection.dll failed.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarCode.dll with exit code 1.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-x64\linked\IronBarCode.dll
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID F35CA741-19B5-06CC-177A-D9451D192725
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C

4>[IronBarcodeDetection.dll] Exec (with response file contents expanded) in D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile: MONO_PATH=D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked; MONO_ENV_OPTIONS= C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.1\Sdk\..\tools\mono-aot-cross.exe --debug --nollvm "--aot=asmwriter,temp-path=obj\Release\net8.0-android\android-arm\aot\armeabi-v7a\IronBarcodeDetection,profile-only,profile=C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile,profile=C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile,mtriple=armv7-linux-gnueabi,tool-prefix=C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\tools\binutils\bin\arm-linux-androideabi-,outfile=obj\Release\net8.0-android\android-arm\aot\IronBarcodeDetection.dll.so,temp-path=obj\Release\net8.0-android\android-arm\IronBarcodeDetection.dll.tmp,ld-name=ld,ld-flags=--no-relax -s" "obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll"
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll with exit code 1.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Failed to load method 0x600007a from 'D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll' due to Could not resolve signature of method Iron.BarCode.Extensions.aysidy`1+<>c[T]:pivcbt.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID 989A889B-B758-9E90-7469-AE37D2D43981
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Could not load signature of Iron.BarCode.Extensions.aysidy`1+<>c[T]:pivcbt due to: Could not load file or assembly 'Clipper, Version=6.4.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Run with MONO_LOG_LEVEL=debug for more information.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOT of image D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarcodeDetection.dll failed.
4>[IronBarCode.dll] Exec (with response file contents expanded) in D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile: MONO_PATH=D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked; MONO_ENV_OPTIONS= C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm\8.0.1\Sdk\..\tools\mono-aot-cross.exe --debug --nollvm "--aot=asmwriter,temp-path=obj\Release\net8.0-android\android-arm\aot\armeabi-v7a\IronBarCode,profile-only,profile=C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile,profile=C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile,mtriple=armv7-linux-gnueabi,tool-prefix=C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\tools\binutils\bin\arm-linux-androideabi-,outfile=obj\Release\net8.0-android\android-arm\aot\IronBarCode.dll.so,temp-path=obj\Release\net8.0-android\android-arm\IronBarCode.dll.tmp,ld-name=ld,ld-flags=--no-relax -s" "obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll"
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll with exit code 1.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Failed to load method 0x6000d1d from 'D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll' due to Could not load file or assembly 'Azure.Data.Tables, Version=12.8.2.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' or one of its dependencies..
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID 96D5F8C0-B26F-EA75-8F80-DCAB8077BC13
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'C:\Users\sarthakc1\.nuget\packages\microsoft.maui.controls.build.tasks\8.0.7\buildTransitive\netstandard2.0\maui-blazor.aotprofile'
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Run with MONO_LOG_LEVEL=debug for more information.
4>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOT of image D:\TSMXamCopyRepo2\Mobile\NOV.WBT.TSM.Mobile\obj\Release\net8.0-android\android-arm\linked\IronBarCode.dll failed.
@SarthakB26 SarthakB26 added the t/bug Something isn't working label Feb 15, 2024
@SarthakB26 SarthakB26 changed the title Getting trimming error when building in release mode [Android] Getting AOT/Precompiling error when building in release mode [Android] Feb 15, 2024
@drasticactions
Copy link
Contributor

drasticactions commented Feb 15, 2024

The errors log state that "Clipper" and "Azure.Data.Tables" are missing, probably because they are not being explicitly referenced to be included. I'm not sure if that's an issue with the library or the Android build process (CC @jonathanpeppers if you know), but it's easy to fix.

https://github.com/drasticactions/MauiRepros/tree/main/AndroidTrimmerTest

https://github.com/drasticactions/MauiRepros/blob/28fb3b9b8c2ed13b05d93930d91d8c45da2da591/AndroidTrimmerTest/AndroidTrimmerTest.csproj#L12-L16

Add it as a reference and it should build. Also note that this is not a MAUI UI related issue, you would hit this on a plain .NET Android app, and my guess is that it's something that needs to be fixed with that library specifically.

@drasticactions drasticactions added the s/needs-info Issue needs more info from the author label Feb 15, 2024
@ghost
Copy link

ghost commented Feb 15, 2024

Hi @SarthakB26. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@SarthakB26
Copy link
Author

SarthakB26 commented Feb 15, 2024

@drasticactions thanks for the quick response really appreciated.
will check you suggestion and update my only concern is if its library issue it should throw error in debug mode as well
On debug I am able to generate barcode just fine

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Feb 15, 2024
@drasticactions
Copy link
Contributor

It won't fail in Debug because of AOT. Release mode compiles with MonoAOT and, for whatever reason, those libraries are not included. My assumption is that it's a library issue for not including those assemblies or it could be something that needs to be preserved to prevent being trimmed. It could also be a runtime issue that it's not included.

Regardless, it's not a MAUI UI issue or related to code in this repo. It's most likely a runtime build issue or a library one that Barcode would need to address.

@SarthakB26
Copy link
Author

above suggestion worked thanks.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/android 🤖 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants