-
Notifications
You must be signed in to change notification settings - Fork 532
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
Android app build fails during "SdkOnly" linking when referencing package (e.g. Entity Framework Core 2.1) that depends on newer System.Memory #1813
Comments
Thanks for creating this issue. I'm seeing the exact same problem here. |
With VS Windows 15.7.4 I was able to get the sample project to build after installing the
Now I don't know if the resulting app works at runtime. Can you give this a try? I think part of the problem here was the bad error message. Using latest master we have improved this, it says:
Next, it should tell you to add |
Thanks, Jonathan. I'll test that out tonight. Technically speaking, shouldn't System.Memory automatically bring in System.Buffers without us needing to add it manually? |
After looking into this, it appears that transitive dependencies for Somewhat related to: NuGet/Home#4488 Reviewing the binary build log after only adding But! it is in my "System.Buffers/4.4.0": {
"type": "package",
"compile": {
"ref/netstandard2.0/_._": {}
},
"runtime": {
"lib/netstandard2.0/System.Buffers.dll": {}
}
}, I am wondering if this a behavior of using non-SDK-style projects. Perhaps it would work properly if Xamarin.Android supported SDK-style projects? (the new project system) |
Well, my project now builds after updating EF and its many dependencies to 2.1.1. Debug configuration runs fine, release configuration crashes on startup. Since the release configuration tends to not be debuggable, I changed my debug configuration to resemble the release configuration by setting AndroidLinkMode=SdkOnly and AndroidUseSharedRuntime=false. This reproduced the following unhandled exception on startup:
This is in the following code:
I'm not 100% sure this is what's happening with the release configuration, or how this relates to EF 2.1.1, or what could even cause this exception, but there you go. |
@mfeingol try nuking your Also, I would just run the |
Just a heads up that I had been seeing this error and just tried the new preview 3 release of 15.8 (windows). I don't get the related errors anymore and I can run and deploy using latest EF 2.1.1 release nugets. Hope that helps someone. I have to stay on 15.8 Pre3 now because I was "ef blocked" on both Android and iOS builds. |
As for @dgerding's success, I think there are a couple PRs in 15.8 that help with this issue:
I'm going to close this for now. @cwrea feel free to reopen if you have an update! @mfeingol can you post a new issue about your crash? It seems somewhat unrelated to the original issue. |
@jonathanpeppers: good call on the Android log. I don't use that enough. Looks like it's an exception during EF initialization. Looks to be dotnet/efcore#12460 so I'll be heading off there. Thanks for the help.
|
Steps to Reproduce
Download, extract, and load the sample solution in Visual Studio 15.7.3:
AndroidEFCore21LinkedSoln.zip
Note: This is the same sample solution as I created for Android app build fails when referencing package (e.g. Entity Framework Core 2.1) that depends on newer System.Memory #1769 (now closed, fixed in 15.7.3) except I modified the project's Debug configuration AndroidLinkMode setting from None to SdkOnly.
Build the project.
Expected Behavior
The project should build and deploy to device.
Actual Behavior
The build fails at the linker stage, with the following error:
FWIW, if you were to downgrade the
Microsoft.EntityFrameworkCore.Sqlite
package to 2.0.3, which no longer indirectly depends onSystem.Memory
4.5, then the project builds and is deployed to device.Version Information
Log File
adb logcat
output is not applicable as the app didn't even build.Example Project
AndroidEFCore21LinkedSoln.zip
The text was updated successfully, but these errors were encountered: