il-repack
il-repack copied to clipboard
Exception when merging
Hi,
I'm getting the following exception when attempting to merge:
System.ArgumentException: Value does not fall within the expected range.
at Mono.Cecil.SignatureWriter.WriteCustomAttributeEnumValue(TypeReference enum_type, Object value)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeElement(TypeReference type, CustomAttributeArgument argument)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeFixedArgument(TypeReference type, CustomAttributeArgument argument)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeNamedArgument(Byte kind, CustomAttributeNamedArgument named_argument)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeNamedArguments(Byte kind, Collection`1 named_arguments)
at Mono.Cecil.SignatureWriter.WriteICustomAttributeNamedArguments(ICustomAttribute attribute)
at Mono.Cecil.MetadataBuilder.GetCustomAttributeSignature(CustomAttribute attribute)
at Mono.Cecil.MetadataBuilder.AddCustomAttributes(ICustomAttributeProvider owner)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypeDefs()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at ILRepacking.ILRepack.Repack()
at ILRepacking.Application.Main(String[] args)
My scenario is I'm just playing around with attempting to merge the DLLs that comprise an APK. I am hoping to squash it down to a single DLL to see whether there is any impact on Xamarin Android performance.
@kentcb Which ILRepack version? Also, do you have a reproducible sample/reproduction path?
@timotei version is 2.0.12. Unfortunately, the app I'm running this against isn't yet live in Google Play store. Can I send the APK to you directly?
@kentcb That works too (you can do it via the rx slack). Does it also happen on a new sample app (maybe with some library as dependency)?
Also, Windows or UNIX?
I am attempting to do this on Windows. I'll ping you with the APK 👍
Instructions for repro:
- Unzip the provided APK to
$root
-
cd $root\assemblies
-
ILRepack.exe /union /wildcards /out:whatever.dll /verbose QUT.dll *.dll
I get the same exception when referencing netstandard libraries.
Please reopen if this still reproduces on the latest version.