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

VS 17.3.4 Breaks Android build with - Manifest file at 'obj\Debug\net6.0-android\android-arm\staticwebassets.build.json' not found #10102

Closed
jordanwilcox opened this issue Sep 13, 2022 · 70 comments · Fixed by #9393
Assignees
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging fixed-in-6.0.536 Look for this fix in 6.0.536 SR4.1! fixed-in-6.0.540 Look for this fix in 6.0.540 SR5! fixed-in-7.0.0-rc.1.6683 p/0 Work that we can't release without platform/android 🤖 t/bug Something isn't working
Milestone

Comments

@jordanwilcox
Copy link

jordanwilcox commented Sep 13, 2022

Description

Since updating to VS 17.3.4 I can't build any MAUI Android projects on my machine.

I have verified this on two devices running VS - before updating to VS 17.3.4 it was building ok - post update to 17.3.4 the build errors show for android.

I am unable to verify if this affects iOS but the build errors seem to point only at android.

This is happening on dotnet --version 6.0.401

Steps to Reproduce

  1. Update to VS 17.3.4
  2. Create a brand new MAUI project (I used MAUI blazor for testing)
  3. Attempt a build
  4. Fails

Link to public reproduction project repository

https://github.com/jordanwilcox/maui-build-error-android-17.3.4

Version with bug

SDK 6.0.401

Last version that worked well

SDK 6.0.400

Affected platforms

Android

Affected platform versions

All android platforms

Did you find any workaround?

Workaround found by @cupsos by changing global.json in solution to sdk version 6.0.400

Relevant log output

1>C:\Program Files\dotnet\sdk\6.0.401\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(680,7): error : Manifest file at 'obj\Debug\net6.0-android\android-arm\staticwebassets.build.json' not found.
1>C:\Program Files\dotnet\sdk\6.0.401\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(680,7): error : Manifest file at 'obj\Debug\net6.0-android\android-x86\staticwebassets.build.json' not found.
1>Done building project "MauiApp1.csproj" -- FAILED.
1>C:\Program Files\dotnet\sdk\6.0.401\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(680,7): error : Manifest file at 'obj\Debug\net6.0-android\android-x64\staticwebassets.build.json' not found.
1>Done building project "MauiApp1.csproj" -- FAILED.
1>C:\Program Files\dotnet\sdk\6.0.401\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(680,7): error : Manifest file at 'obj\Debug\net6.0-android\android-arm64\staticwebassets.build.json' not found.
1>Done building project "MauiApp1.csproj" -- FAILED.
@jordanwilcox jordanwilcox added the t/bug Something isn't working label Sep 13, 2022
@peter-bozovic
Copy link

Same issue here :(

@GioviQ
Copy link

GioviQ commented Sep 14, 2022

Closing VS, deleting bin and obj folder works for the first build, then the error appears again

@cupsos
Copy link

cupsos commented Sep 14, 2022

I'm on the same boat.

If you want to use VS 17.3.4 with MAUI now, try this.

  1. Install SDK 6.0.400
  2. Specify SDK version as 6.0.400 at global.json
{
    "sdk": {
        "version": "6.0.400"
    }
}

Maybe SDK issue?


Edit:

Windows update KB5017915 pushing SDK 6.0.400 to 6.0.401 and will not work above.
Do not install KB5017915 if you want keep 6.0.400.

I just tried SDK 6.0.304 but no luck.

For who can't find 6.0.400
Animation

@jsuarezruiz jsuarezruiz added platform/android 🤖 area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging labels Sep 14, 2022
@jessestr
Copy link

jessestr commented Sep 14, 2022

Same issue. Uninstalled 17.3.4 and installed 17.3.2 again and now it's totally bricked.
Reinstalled 17.3.4, same errors again as @jordanwilcox stated in initial post.

Tried to install the 6.0.400 SDK and put it in the global.json but doesn't work.

Global.json was in the wrong directory for some reason. Works again now with 6.0.400

Also seems like it's rebuilding everytime you deploy to a local Android device. Takes ages to test things.
Edit: fast deploy was automatically disabled after the update...

@GioviQ
Copy link

GioviQ commented Sep 14, 2022

But SDK has been correctly updated from Visual Studio. No need to do separete setup
Immagine 2022-09-14 133225

Despite the build errors, If I run the app, it works on Windows (Android not tested).

@hamedhajiloo
Copy link

Same issue! :/

@stimm4711
Copy link

Having this issue, too...

@mhrastegari
Copy link

same here :(

@ltemimi
Copy link

ltemimi commented Sep 14, 2022

same here rolling back to previous version this crazy

@stimm4711
Copy link

I'm on the same boat.

If you want to use VS 17.3.4 with MAUI now, try this.

  1. Install SDK 6.0.400
  2. Specify SDK version as 6.0.400 at global.json
{
    "sdk": {
        "version": "6.0.400"
    }
}

Maybe SDK issue?

Helped me! Just needed to add the global.json in the solution folder to use the SDK version 6.0.400. Thanks.

@jordanwilcox
Copy link
Author

I'm on the same boat.

If you want to use VS 17.3.4 with MAUI now, try this.

  1. Install SDK 6.0.400
  2. Specify SDK version as 6.0.400 at global.json
{
    "sdk": {
        "version": "6.0.400"
    }
}

Maybe SDK issue?

Thank you this works for me too, I have updated the main ticket with this workaround to help others. 😊

@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Sep 14, 2022
@GreatIdeaz
Copy link

It's already 6.0.401 :) if you follow the link !

@danfer
Copy link

danfer commented Sep 14, 2022

It's already 6.0.401 :) if you follow the link !

Yeah, can't find 6.0.400, hope it gets fixed soon

@danfer
Copy link

danfer commented Sep 14, 2022

Ok guys, for the meantime, I was able to make it to work, just did a search for file staticwebassets.build.json and found it at folder net6.0-android, so just copied it at folders where building was breaking and now it is working, cheers.

@Haichen-Dong
Copy link

It works. Thank you.

@ibanks42
Copy link

Ok guys, for the meantime, I was able to make it to work, just did a search for file staticwebassets.build.json and found it at folder net6.0-android, so just copied it at folders where building was breaking and now it is working, cheers.

I found the 6.0.400 SDK at a different website third-party but it still did not work for me. This workaround did, however.

Here's the link to the third-party site in case someone gets any use out of it: https://versionsof.net/core/6.0/6.0.8/

@dsuny
Copy link

dsuny commented Sep 15, 2022

obj\Debug\net6.0-android\staticwebassets.build.json
Copy
obj\Debug\net6.0-android\android-arm64\staticwebassets.build.json

@TrabacchinLuigi
Copy link

TrabacchinLuigi commented Sep 15, 2022

tried both the sdk and the file copy one. it still complains about missing dependencies now

@hamedhajiloo

This comment was marked as off-topic.

@samhouts samhouts added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Sep 15, 2022
@matheusjulio96
Copy link

Same issue here

@MargaritaLoseva
Copy link

The same issue

@KieranDevvs
Copy link

Same issue here.

1 similar comment
@isaac-borrero
Copy link

Same issue here.

@xiangnanscu
Copy link

Same issue here

@stallprobbe
Copy link

Try it just now, it works :-)

@tibitoth

This comment was marked as off-topic.

@sake402

This comment was marked as off-topic.

@arsalanhub
Copy link

Same issue. Uninstalled 17.3.4 and installed 17.3.2 again and now it's totally bricked. Reinstalled 17.3.4, same errors again as @jordanwilcox stated in initial post.

Tried to install the 6.0.400 SDK and put it in the global.json but doesn't work.

Global.json was in the wrong directory for some reason. Works again now with 6.0.400

Also seems like it's rebuilding everytime you deploy to a local Android device. Takes ages to test things. Edit: fast deploy was automatically disabled after the update...

Where can I find Global.json file? Also you said Global.json was in wrong directory. Can you tell me what should be location of Global.json?

@liebki
Copy link

liebki commented Sep 22, 2022

Here you go, it's a file you need to create in the project/solution.
https://learn.microsoft.com/en-us/dotnet/core/tools/global-json
https://alessio.franceschelli.me/posts/dotnet/should-i-use-global-json/

Same issue. Uninstalled 17.3.4 and installed 17.3.2 again and now it's totally bricked. Reinstalled 17.3.4, same errors again as @jordanwilcox stated in initial post.
Tried to install the 6.0.400 SDK and put it in the global.json but doesn't work.
Global.json was in the wrong directory for some reason. Works again now with 6.0.400
Also seems like it's rebuilding everytime you deploy to a local Android device. Takes ages to test things. Edit: fast deploy was automatically disabled after the update...

Where can I find Global.json file? Also you said Global.json was in wrong directory. Can you tell me what should be location of Global.json?

@danroth27
Copy link
Member

@samhouts hello. I follow your advice and run dotnet workload update and can't create maui blazor project anymore (no template), what should do I do?

@xiangnanscu There appears to be an issue with dotnet workload update when .NET MAUI was installed using VS. Instead, run dotnet workload install maui to bring back the templates and get the latest .NET MAUI bits that fix this issue. Note that this will only install .NET MAUI for the active .NET SDK. You can switch the active .NET SDK by creating a global.json file with the desired .NET SDK version.

@xiangnanscu
Copy link

@danroth27 thanks. I run dotnet workload restore in the project folder and problem solved. I just feel a little wiered that this command required to be run in a specific project folder but it installs some global workload becasuse after that maui blazor template is available.
Also does what I do is the same as dotnet workload install maui as you suggest? If not, I follow yours.

@danroth27
Copy link
Member

@xiangnanscu I believe dotnet workload restore basically does a dotnet workload install for the workloads it detects a project needs.

@alexdbkim
Copy link

alexdbkim commented Sep 24, 2022

@tb-mtg your workaround resolved this issue! Thank you. I modified little bit on you suggestion to support both Debug build and Release build.

  1. Open MAUI project csproj file.
  2. Add below section after <ItemGroup> section (basically at the end of file before </Project>)
  <Target Name="TempFixBeforeBuild" BeforeTargets="PreBuildEvent" >
    <Copy SourceFiles="$(ProjectDir)obj\$(Configuration)\net6.0-android\staticwebassets.build.json" DestinationFiles="$(ProjectDir)obj\$(Configuration)\net6.0-android\android-arm\staticwebassets.build.json" />
    <Copy SourceFiles="$(ProjectDir)obj\$(Configuration)\net6.0-android\staticwebassets.build.json" DestinationFiles="$(ProjectDir)obj\$(Configuration)\net6.0-android\android-arm64\staticwebassets.build.json" />
    <Copy SourceFiles="$(ProjectDir)obj\$(Configuration)\net6.0-android\staticwebassets.build.json" DestinationFiles="$(ProjectDir)obj\$(Configuration)\net6.0-android\android-x64\staticwebassets.build.json" />
    <Copy SourceFiles="$(ProjectDir)obj\$(Configuration)\net6.0-android\staticwebassets.build.json" DestinationFiles="$(ProjectDir)obj\$(Configuration)\net6.0-android\android-x86\staticwebassets.build.json" />
  </Target>

This may still fail especially with rebuild. Building once again should be successful though. I know it's not the best but still better than being blocked by this issue I guess :) Hope this is cleaned up soon.

UPDATE:

dotnet workload install maui should resolved the issue and no longer need to have customer PreBuildEvent as workaround.

@danroth27
Copy link
Member

@alexdbkim Did you try running dotnet workload install maui to get the latest .NET MAUI servicing release, which should have a fix for this issue?

@tb-mtg
Copy link

tb-mtg commented Sep 27, 2022

Thanks @alexdbkim - I think doing the workload install maui has fixed my issue.

@shugaoye
Copy link

I have the same issue and use the above workaround temporarily.

@alexdbkim
Copy link

@danroth27 @tb-mtg Yes I can confirm the suggested commend fixed the issue. I can build without the temporary workaround now.

FIX:
dotnet workload install maui

@stallprobbe

This comment was marked as off-topic.

@PaulSorauer-IPG

This comment was marked as off-topic.

@TrabacchinLuigi

This comment was marked as off-topic.

@stallprobbe

This comment was marked as off-topic.

@stallprobbe

This comment was marked as off-topic.

@OskrLrba
Copy link

I have just updated to VS 17.3.5. It seems it's ok but yesterday I run dotnet workload install maui as @danroth suggested so I don't know if this new version fixes this issue. Have you tested it?

@GreatIdeaz
Copy link

GreatIdeaz commented Sep 28, 2022 via email

@GreatIdeaz
Copy link

GreatIdeaz commented Sep 28, 2022 via email

@KieranDevvs

This comment was marked as off-topic.

@KieranDevvs
Copy link

This is confirmed to be fixed in 17.3.5, can this issue be closed?

@GreatIdeaz
Copy link

GreatIdeaz commented Sep 28, 2022 via email

@samhouts
Copy link
Member

Thank you everyone for your patience! Please update to 17.3.5 if you haven't already. This is now resolved!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2022
@samhouts samhouts added fixed-in-6.0.540 Look for this fix in 6.0.540 SR5! fixed-in-6.0.536 Look for this fix in 6.0.536 SR4.1! labels Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging fixed-in-6.0.536 Look for this fix in 6.0.536 SR4.1! fixed-in-6.0.540 Look for this fix in 6.0.540 SR5! fixed-in-7.0.0-rc.1.6683 p/0 Work that we can't release without platform/android 🤖 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.