-
Notifications
You must be signed in to change notification settings - Fork 524
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
Extraneous "The "FilterAssemblies" task failed unexpectedly" error appears for builds inside Visual Studio if an app references a .NET Standard library that did not build successfully #3423
Comments
thats exactly what i was getting on windows. thanks for detailing this bug. I hope that it will be solved in next release as soon as possible |
I'm also getting this error in Xamarin Forms App on VS 16.2.1 and Xamarin Android 9.4.1.0 |
@Im-PJ , for the scenario described in this particular issue, if you are getting the same call stack shown in the description that says "Could not find file," that means that one of the projects referenced by your Android application project failed to build due to another error. To resolve the problem, you'll want to look at the other errors in Error List window and resolve those. If you are seeing an error that is similar to the one shown in the description but without any additional errors from other projects, that would be a separate problem. One possibility could the slightly different error shown in #3379. If that issue also does not match the behavior you are seeing, then if you could submit a new issue with the full text of the error you are seeing, plus the saved diagnostic MSBuild output or a zipped up test case that demonstrates the issue, that would be perfect. Thanks in advance! |
Thanks for explaining. Yes I'm getting "Could not find file" error as described in this issue. My android project only references portable .net standard project. I removed all nugets, cleaned solution but still it doesn't build. Im not getting any other error that can help me identify the issue. |
@Im-PJ , I'm not sure what circumstances would be most likely to produce this error if it is not accompanied by other errors. If you could submit a new issue with the full text of the error you are seeing, plus the saved diagnostic MSBuild output or a zipped up test case that demonstrates the issue so the team can investigate further, that would be perfect. Thanks in advance! |
Look at the dll listed in the error (NetStandardLibrary1 above) then check references in folders of projects that might cite it. I found it eventually that way. A vague error message but it meant what it said. |
This happened with me after upgrading from X.F 3.6 to X.F 4.2 |
I was getting the same error but i am not sure directly connected with the same problem of yours but just for the info. Someone said that this problem may arise when you try to read a file that does not exist. And when i checked my codes i saw that a |
I am also getting this happened with me after upgrading from X.F 2.5 to X.F 4.2, what I do ?? |
When run my app in debug mode it deploy successfully but when in realease mode I have this error and app cannot deploy. Anyone know how to solve this yet?
|
@moniquealtero, what you're seeing is a bit different. This issue is about the scenario where the "LinkAssemblies" error appears together with a
What you're seeing is that the linker is finding all of the assemblies, but it's not able to resolve one of the types within one of the assemblies:
One common cause of resolution errors like that is if some NuGet packages referenced by the project are out-of-date. If updating the NuGet packages doesn't help, and you get stuck on that error, please do submit a new issue to describe your scenario so the team can take a look. Thanks in advance! |
As a clarification in case it might help for other users who come across this issue, this particular issue is only about changing the wording of the error message so that it's more familiar. The scenario covered by this particular GitHub issue is that I intentionally made a typo in a .NET Standard library referenced by a Xamarin.Android app. In order to fix that error, I would need to correct the typo I made in my own .NET Standard library project. As an example of how the wording could be improved in the future, one good option would be for Xamarin.Android projects to produce the same error for this scenario as .NET Core and .NET Framework console apps:
|
Thank you, I'll try this steps. |
Hi all. I'm getting this too on VS for Mac 8.3.2 after attempting to produce an archive against Target Framework Android 10 (Q). Interestingly enough, our app actually deploys and BUILDS successfully on debug and release modes, so I think this rules out an error with dependencies not building successfully. The error, however, happens when we try to archive the app to produce an APK. The same happens in our CI pipeline while trying to create the binary using App Center against Xamarin.Android 9.4 and above.
|
I'm not sure yet but I think that if you updated to Android Q all your nugget packages have to support it and not all of them do this yet. You can check this in your Nuget Android packages at description section. |
Cross-referencing notes for the team The behavior of this scenario is improved in Visual Studio 2019 version 16.4 Preview by #3609. In that version, the error message no longer starts with the misleading mention of FilterAssemblies. The behavior is fully fixed in the d16-5 development builds by #3720. Once the change from that pull request is published, this scenario will produce the standard Metadata file ... could not be found error from the |
Release status update A new Preview version has now been published on Windows that includes the fix to produce the standard Metadata file ... could not be found error message for this scenario. The fix is not yet included in a Release version. I will update this item again when a Release version is available that includes the fix. The fix is not yet available on macOS. I will update this item again when a Preview version with the fix is available on macOS. Fix included in Xamarin.Android 10.2.0.16. Fix included on Windows in Visual Studio 2019 version 16.5 Preview 1. To try the Preview version that includes the fix, check for the latest updates in Visual Studio Preview. Fix not yet available on macOS. |
Hi Mr Brendan Zagaeski |
Hi again. About this issue is this way correct? (I'm in hurry! and can't wait for Mac release) what is your idea about that? |
Hi @MehdiJafari84, that sounds interesting, like maybe somehow the current solution configuration might not be building the .NET Standard or PCL project automatically as needed when you build the Android app project that depends on it. If you get stuck with investigating why the library isn't building when expected, you can submit a new issue with the diagnostic build output for the Android app project or a zipped up test case that demonstrates the issue, and the team can take a look. Thanks in advance! |
Release status update A new Preview version has now been published on macOS that includes the fix for this item. The fix is not yet included in a Release version. I will update this item again when a Release version is available that includes the fix. Fix included in Xamarin.Android 10.2.0.84. Fix included on macOS in Visual Studio 2019 for Mac version 8.5 Preview 1. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel. (Fix also included on Windows in Visual Studio 2019 version 16.5 Preview 1 and higher. To try the Preview version that includes the fix, check for the latest updates in Visual Studio Preview.) |
Release status update A new Release version has now been published on Windows that includes the fix for this item. The fix is not yet published in a Release version on macOS. I will update this item again when a Release version is available on macOS that includes the fix. Fix included in Xamarin.Android 10.2.0.100. Fix included on Windows in Visual Studio 2019 version 16.5. To get the new version that includes the fix, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/. (Fix also included on macOS in Visual Studio 2019 for Mac version 8.5 Preview 1 and higher. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel.) |
Release status update A new Release version has now been published on macOS that includes the fix for this item. Fix included in Xamarin.Android 10.2.0.100. Fix included on macOS in Visual Studio 2019 for Mac version 8.5. To get the new version that includes the fix, check for the latest updates on the Stable updater channel. (Fix also included on Windows in Visual Studio 2019 version 16.5 and higher. To get the new version that includes the fix, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/.) |
This is a possible area for follow-up related to #2795.
In my testing so far, this only seemed to affect builds that happened within Visual Studio. Command line builds aborted after they hit the error in the .NET Standard library, so they didn't attempt to run any targets in the Android app project.
Steps to reproduce
Build the attached test case within Visual Studio 2019 version 16.2 or higher.
Test case: FilterAssembliesAfterError.zip
Expected behavior
One of the following:
The Android app build aborts with no errors.
This is what now happens in Visual Studio 2019 version 16.2 if there are syntax errors in a referenced Android library project (in contrast to a .NET Standard library project). This has a nice consequence that only the errors from the Android class library project appear in the Error List.
Or the build proceeds all the way to the
CoreCompile
target so thatcsc
emits an error.This is what happens for a .NET Core app that references a .NET Standard library that contains syntax errors.
Or, if neither of those options is easy to do, maybe the build could fail with the old
LinkAssemblies
task error orResolveLibraryProjectsImport
task error for this particular scenario. That way, the error message would at least be familiar for existing users.Actual behavior
The app project emits an extraneous build error that is also unfamiliar because it did not exist in previous versions of Xamarin.Android:
Log file
MSBuildBinlogs.zip
The text was updated successfully, but these errors were encountered: