Closed bruzkovsky closed 5 years ago
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
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>
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?
@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
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.
@tdcaesar ok I see, thanks for pointing that out!
@tdcaesar I cannot use your solution with #174 workaround.
Have you tried adding
To the First
Yes, but your solution invalidate #174 workaround.
@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.
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: https://github.com/jamesmontemagno/InAppBillingPlugin/commit/1220af465fe6045cbf2b9e19b13909a0f0355523
Can you try Extras 2.0.41
? Should have a fix for this.
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.
Thanks, @onovotny, it works like a charm.
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:
>>> Download Diagnostic Build Output
>>> Download VS Info
repro_xam_android_filterassemblies.zip