Skip to content

Could not AOT the assembly build failure with version 2.0.1 in Xamarin.iOS projects #2676

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

Closed
aspnet-hello opened this issue Jan 2, 2018 · 7 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-http-abstractions

Comments

@aspnet-hello
Copy link

From @therealjohn on Wednesday, November 29, 2017 2:08:10 PM

Functional impact

Adding the latest versions of this NuGet, or any NuGet that has it as a valid dependency that would pull in the latest version will cause a build failure for device builds in Xamarin.iOS projects.

Minimal repro steps

  1. Create a File > New Solution > Single View iOS Application. You can do these steps in VSMac or VS on Windows.
  2. Install-Package Microsoft.Net.Http.Headers -Version 2.0.1 for the iOS project in VS or use the Add Packages menu in VSMac to add this NuGet.
  3. Open the AppDelegate.cs file and add this line of code in the FinishedLaunching method.
// Arbitrary type used from the package so it's included in the build
new Microsoft.Net.Http.Headers.CacheControlHeaderValue();
  1. Change the build configuration to Debug | iPhone (Generic Device)
  2. Build the iOS project

Expected result

Build Success

Actual result

Build fails.

/Users/johnmiller/Projects/TestingSA/TestingSA/MTOUCH: Error MT3001: Could not AOT the assembly '/Users/johnmiller/Projects/TestingSA/TestingSA/obj/iPhone/Debug/mtouch-cache/Build/Microsoft.Net.Http.Headers.dll' (MT3001) (TestingSA)

Further technical details

Attached is the full build output.
fullbuildoutput.txt
Downgrading to version 2.0.0 of the package works around this issue.

If this is not the correct place to file the issue, please let me know!

Copied from original issue: aspnet/HttpAbstractions#974

@aspnet-hello
Copy link
Author

From @nbsoftware on Sunday, December 10, 2017 9:42:10 AM

​I can confirm the issue. And I also confirm that downgrading to Microsoft.Net.Http.Headers package to 2.0.0 does work around it.

@aspnet-hello
Copy link
Author

From @michelmoorlag on Monday, December 18, 2017 1:18:35 AM

Same issue here when I try to build a XF IOS adhoc app. Downgrading Microsoft.Net.Http.Headers package to version 2.0.0 fixed the issue for me.

@LuigiMaestrelli
Copy link

Same problem here.
Any news?

@danielmeza
Copy link

I solve the problem, you need to change the linker behavior to Link Framework SDKs Only and disabe the Enalble device-specific build on your proyect configuration.
your configuration may look like this
image

@muratg
Copy link
Contributor

muratg commented Jan 31, 2018

Closing per @danielmeza's last comment.

@muratg muratg closed this as completed Jan 31, 2018
@muratg
Copy link
Contributor

muratg commented Jan 31, 2018

@therealjohn if you still have issues, please ping me. Thanks.

@jorisvergeer
Copy link

jorisvergeer commented Feb 19, 2018

Still an issue when building on microsoft appcenter, even with suggested settings.
Downgrade to 2.0.0 is still the workaround

(Local build did work tough)

@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-http-abstractions
Projects
None yet
Development

No branches or pull requests

7 participants