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

[Xamarin.MonoAndroid]: The "FilterAssemblies" task was not given a value for the required parameter "DesignTimeBuild" #173

Closed
bruzkovsky opened this issue Jul 29, 2019 · 15 comments

Comments

@bruzkovsky
Copy link

bruzkovsky commented Jul 29, 2019

After updating to VS 16.2.0 (Windows), my release build fails with the following message:

MSB4044: The "FilterAssemblies" task was not given a value for the required parameter "DesignTimeBuild"

The .csproj is configured like this:

<TargetFrameworks>netstandard2.0;MonoAndroid81;Xamarin.iOS10;uap10.0.16299</TargetFrameworks>

My global.json:

{
    "msbuild-sdks": {
        "MSBuild.Sdk.Extras": "2.0.31"
    }
}

>>> Download Diagnostic Build Output

>>> Download VS Info

repro_xam_android_filterassemblies.zip

@bruzkovsky
Copy link
Author

I also have a workaround (for my cake-script, but in essence it should work for every build setup):

// build.cake
// ....

Task("Build")
//.IsDependentOn ...
.Does(() =>
{
MSBuild(solution, settings => {
            settings.SetConfiguration(configuration);
            settings.MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86;
            settings.WithProperty("version", version);
            // workaround bug in MSBuildSdkExtras / Xamarin.Android
            settings.WithProperty("DesignTimeBuild", "false");
        });
}

// ....

Maybe this helps someone.

Cheers

@bruzkovsky
Copy link
Author

#168 looks related.

@tdcaesar
Copy link

The same problem has been frustrating me. One way to determine if you have the same problem is to try and pack the project manually by setting '/p:DesignTimeBuild="false"' in the msbuild command. If it completes successfully, the congratulations, there is a solution. For example:

msbuild MY_Project.csproj /t:pack /p:DesignTimeBuild="false"

If you aren't using Cake, then you can also get around the issue by setting the DesignTimeBuild property to false. Just add it to an existing property group. Don't add it to an ItemGroup. I made this mistake thinking to use the existing Android conditional ItemGroup.

<PropertyGroup Label="Android DesignTimeBuild error workaround"> 
  <DesignTimeBuild>false</DesignTimeBuild>
</PropertyGroup>

@clairernovotny
Copy link
Collaborator

I can't seem to repro this in 16.3 preview 1. Does it happen for you there? If so, is there a small repro you can attach?

@bruzkovsky
Copy link
Author

bruzkovsky commented Aug 6, 2019

@onovotny here is my project, separated into a new solution:
repro_xam_android_filterassemblies.zip

I can reproduce it by running a Release build. Debug works.

Edit: I will try to reproduce it on 16.3 preview 1 when I can free up some time

@tdcaesar
Copy link

tdcaesar commented Aug 6, 2019

You won't see it in debug because it only happens when you Pack. This project is set to pack on release and so you see the problem. If you set pack on build to false in release then it will finish successfully just like in debug.

@bruzkovsky
Copy link
Author

@tdcaesar ok I see, thanks for pointing that out!

@skarllot
Copy link

skarllot commented Aug 6, 2019

@tdcaesar I cannot use your solution with #174 workaround.

@ncunning
Copy link

ncunning commented Aug 6, 2019

Have you tried adding

false

To the First of the affected csproj file.

@skarllot
Copy link

skarllot commented Aug 6, 2019

Yes, but your solution invalidate #174 workaround.

@tdcaesar
Copy link

tdcaesar commented Aug 7, 2019

@skarllot for #174 added Xamarin.Android.Support.Core.Utils Version 28.0.0.1 as workaround. That got rid of the Resource.Designer.cs not found issue and works with the DesignTimeBuild issue workaround. There was a comment about ResourceGen which should work, but caused a problem for me.

@jamesmontemagno
Copy link

I had an odd dependency on the new billing library and it has a dependency on annotations. I had to add the resgen fix and turn off designtime builds too: jamesmontemagno/InAppBillingPlugin@1220af4

@clairernovotny
Copy link
Collaborator

Can you try Extras 2.0.41? Should have a fix for this.

@tdcaesar
Copy link

Thank you, @onovotny . Version 2.0.41 works perfectly. I removed the workaround fixes, updated to 2.0.41, and all worked as it had before. Thank you for the fix.

@bruzkovsky
Copy link
Author

Thanks, @onovotny, it works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants