Build error when referencing a netstandard PCL from an Xamarin.Android project

If I create a .NET Standard 1.5 Class Library in Visual Studio 2017 and reference it from a freshly created Xamarin Android Project I receive the following build output:

3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning : Exception of type 'System.OutOfMemoryException' was thrown.
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.MsfDirectory..ctor(PdbReader reader, PdbFileHeader head, BitAccess bits)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, BitAccess bits, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Pdb2Mdb.Converter.Convert(String filename)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Xamarin.Android.Tasks.ConvertDebuggingFiles.Execute()
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning : Exception of type 'System.OutOfMemoryException' was thrown.
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.MsfDirectory..ctor(PdbReader reader, PdbFileHeader head, BitAccess bits)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, BitAccess bits, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Pdb2Mdb.Converter.Convert(String filename)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Xamarin.Android.Tasks.ConvertDebuggingFiles.Execute()
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning : Exception of type 'System.OutOfMemoryException' was thrown.
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.MsfDirectory..ctor(PdbReader reader, PdbFileHeader head, BitAccess bits)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, BitAccess bits, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Pdb2Mdb.Converter.Convert(String filename)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Xamarin.Android.Tasks.ConvertDebuggingFiles.Execute()
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning : Exception of type 'System.OutOfMemoryException' was thrown.
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.MsfDirectory..ctor(PdbReader reader, PdbFileHeader head, BitAccess bits)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, BitAccess bits, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Pdb2Mdb.Converter.Convert(String filename)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Xamarin.Android.Tasks.ConvertDebuggingFiles.Execute()
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning : Exception of type 'System.OutOfMemoryException' was thrown.
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.MsfDirectory..ctor(PdbReader reader, PdbFileHeader head, BitAccess bits)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, BitAccess bits, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, Boolean readAllStrings)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Pdb2Mdb.Converter.Convert(String filename)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1534,2): warning :    at Xamarin.Android.Tasks.ConvertDebuggingFiles.Execute()

The application will still deploy to the emulator and run, but breakpoints inside the PCL will not be hit. Probably due to the missing debug information. Not being able to debug anything inside the portable core of the app poses a major problem for us.

I've already filed a bug that has yet to be acknowledged.

Sign In or Register to comment.