Bug 60046 - Error when building for Android when nuget libphonenumber-csharp is referenced from a netstandard lib
Summary: Error when building for Android when nuget libphonenumber-csharp is reference...
Status: RESOLVED DUPLICATE of bug 59313
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.4 (15.3)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2017-10-08 21:05 UTC by softlion
Modified: 2017-12-01 11:41 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 59313

Description softlion 2017-10-08 21:05:09 UTC
Setup:
VS2017 on windows
1. A netstandard 2.0 library referencing and using a method from the nuget "libphonenumber-csharp".
2. An android app referncing the netstandard library, and using a method from it.
3. Same for iOS.

build conf is debug.
iOS: Build OK.
Android: Build fails.

Build Log:

3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1397,2): error : Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'PhoneNumbers, Version=8.8.3.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1397,2): error : File name: 'PhoneNumbers.dll'
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1397,2): error :    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1397,2): error :    at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1397,2): error :    at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)
Comment 1 Jon Douglas [MSFT] 2017-10-09 15:19:50 UTC
Hi Softlion,

This sounds similar to the following bug:

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

Which the following comment seems to explain why Android shows this issue before iOS:

https://bugzilla.xamarin.com/show_bug.cgi?id=59313#c8

If you agree with this assessment, please let me know and I'll mark this as a duplicate issue. Otherwise, please attach a reproduction project to your bugzilla report so I can investigate further!
Comment 2 softlion 2017-10-09 16:21:32 UTC
Yes it feels the same. I've not tryed to run the ios version of the app but will do.

The workaround is to add the nuget package again to the android/ios app.
Comment 3 dean.ellis 2017-12-01 11:41:59 UTC
This seems to be a duplicate of 59313

*** This bug has been marked as a duplicate of bug 59313 ***