-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] Microsoft.EntityFrameworkCore.SQlite fails with Xamarin.Forms 4.1.x on IOS #7179
Comments
Here is the stack trace from when this happens
|
@matt-goldman is this by chance something that happened when you updated to 8.3 preview? I'm testing locally and I get this same exception even when running XF 3.5 pinging @spouliot on this one in case the exception looks familiar to him |
@PureWeen that's possible - I'm finding this issue now to be intermittent (currently getting this on XF3.6 running on the simulator but not on physical device). I can no longer reliably create a scenario that either does or doesn't cause this issue, so at this point I'm a little lost. I haven't logged this with Microsoft.EntityFrameworkCore.SQLite, thanks for pinging. |
Sorry, spoke too soon. By disabling linking it works fine in 3.6 on both physical device and simulator, but this has no impact when using XF4.1. |
Is it the same exception on 3.6 and XF 4.1? What you might try is to figure out the linker settings required to make it work on 3.6 once you've done that I would be curious if it then starts working for you on 4.1 |
I set the linker to 'don't link', I could try a more precise configuration but I would have thought that without linking altogether it's not likely that there'd be another setup that would work. I haven't tried specifically preserving parts of the XF or SQLite assembly, do you think this would be worthwhile? As I said setting the linker to Don't Link should just preserve everything. |
You won't really want to release the app with the linker totally off so it's something that I think would need to eventually be figured out
It should but I was just curious if you figured out the linker settings that made it work with 3.6 if a similar setup would make it work for 4.1. If it did then that might help figure out why it's being finicky on 4.1 |
What I did was downgrade to 2.1 and add |
@PureWeen understood, apologies I'm a little out of my depth here. |
pinging @jgold6 as it looks like he's familiar with this issue :-) |
Confirming that using Xamarin.Forms 4.1.0.673156 and Microsoft.EntityFrameworkCore.SQLite 2.1.0 works with the added preserve directive. Linker behvaiour set to Link Platform SDKs Only, tested on iPhone XS Max (physical) and iPhone Xr (simulator), debug and release mode on both, iPhone 6 and 6s (simulators) in debug mode, worked in all scenarios. |
@matt-goldman Does that mean that this issue is resolved and good to close? Thanks! |
@samhouts We've identified a workaround but it looks like XF 4.1 and EFCore SQLite 2.2.6 are incompatible. I don't know which side the problem is on, but if the team are happy for this to be closed with the appropriate workaround in place than I guess that's ok. Otherwise not sure if this needs to be kept open until the root cause is found and fixed. |
@matt-goldman This is not unique to Xamarin.Forms. I'm unclear why you're seeing different behavior with 3.6, but the root cause is dotnet/efcore#10963. I will go ahead and close this report in favor of that one. Thank you!! |
@matt-goldman here's a linker setup that might work for you |
Description
When the EnsureCreatedAsync() method is called, a System.ArgumentNullException is thrown with
Steps to Reproduce
Expected Behaviour
Database should be created or verified. This behaviour occurs as expected when running Xamarin.Forms 3.6.x. Expected behaviour also occurs in Android simulator .
Actual Behaviour
System.ArgumentNullException is thrown
Basic Information
=== Visual Studio Community 2019 for Mac (Preview) ===
Version 8.3 Preview (8.3 build 867)
Installation UUID: 1e1fc119-c410-43fb-b3d5-b89f27185206
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.0.5 (d16-3 / 26f04c54)
=== Mono Framework MDK ===
Runtime:
Mono 6.4.0.81 (2019-06/f55e0a671c0) (64-bit)
Package version: 604000081
=== NuGet ===
Version: 5.2.0.6067
=== .NET Core ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.2.4
2.2.1
2.1.9
2.1.2
2.0.5
SDK: /usr/local/share/dotnet/sdk/2.2.203/Sdks
SDK Versions:
2.2.203
2.2.102
2.1.505
2.1.302
2.1.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks
=== Xamarin.Profiler ===
Version: 1.6.10
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
Xcode 10.2.1 (14490.122)
Build 10E1001
=== Xamarin.Mac ===
Version: 5.16.0.5 (Visual Studio Community)
Hash: 26f04c54
Branch: d16-3
Build date: 2019-06-28 01:31:14-0400
=== Xamarin.iOS ===
Version: 12.16.0.5 (Visual Studio Community)
Hash: 26f04c54
Branch: d16-3
Build date: 2019-06-28 01:31:14-0400
=== Xamarin Designer ===
Version: 16.3.0.17
Hash: 73f0a446c
Branch: remotes/origin/d16-3-release-8.3-p1
Build date: 2019-07-22 17:05:22 UTC
=== Xamarin.Android ===
Version: 9.5.0.27 (Visual Studio Community)
Commit: xamarin-android/d16-3/16c4494
Android SDK: /Users/xxx/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.2
SDK Build Tools Version: 27.0.3
Build Information:
Mono: mono/mono@e6f5369c2d2
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip@b95cf3f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/xxx/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 1.4.0.8
Hash: 28342d0
Branch: remotes/origin/backport-pr-235-to-d16-3~2
Build date: 2019-07-18 16:54:46 UTC
=== Android Device Manager ===
Version: 1.2.0.75
Hash: bf6d603
Branch: remotes/origin/backport-pr-369-to-d16-3~1
Build date: 2019-07-18 16:55:08 UTC
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Build Information ===
Release ID: 803000867
Git revision: ab4af85ea561e474b545e0eada75c5bfe8a92297
Build date: 2019-07-24 14:13:44+00
Build branch: release-8.3-preview1
Xamarin extensions: 45290013e165bcd2db7acbb310e0c16bfe04f0c3
=== Operating System ===
Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Thu Jun 20 18:42:21 PDT 2019
root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64
=== Enabled user installed extensions ===
XAML Styler 1.1.3
MFractor 3.8.16
Xamarin.HotReload 1.0.0.2910000
Reproduction Link
https://github.com/matt-goldman/SQLiteTest
The text was updated successfully, but these errors were encountered: