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

Database connection via Entity Framework fails on iOS device in Release confiuration #22559

Closed
bpitppg opened this issue Sep 16, 2020 · 10 comments
Assignees
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported

Comments

@bpitppg
Copy link

bpitppg commented Sep 16, 2020

Sample iOS application i downloaded from this repository constantly crashes on my iPhones (iOS versions from 13.4-13.7) in Release configuration. Everything is good, when I run it in Debug. There is a problem with connecting to a SQLite database using Entity Framework.

To Reproduce

  • Clone the repository
  • Build 'EFGetStarted.iOS' application in Release configuration
  • Deploy the application to an iPhone
  • Run the application
  • Application crashes

Additional context

Microsoft.Data.Sqlite version: 3.1.5 (the issue also appear after upgrading to 3.1.8)
Target framework: .NET Standard 2.0
Operating system: iOS 13.4-13.7

@ajcvickers
Copy link
Member

/cc @JeremyLikness

@codemillmatt
Copy link

While on an iOS device & in release mode the Xamarin.iOS interpreter needs to be on for EF to work properly. (More info on the Xam.iOS interpreter).

Updated the sample and PR'd it: dotnet/EntityFramework.Docs#2666

@bpitppg
Copy link
Author

bpitppg commented Sep 21, 2020

I did what you proposed, @codemillmatt. However, it didn't work. The application still crashes

@codemillmatt
Copy link

@bpitppg - checking in to let you know I did not forget about you. I'm running down a few loose ends here as to why you're still experiencing crashes. I should have an answer for you soon.

JeremyLikness added a commit to dotnet/EntityFramework.Docs that referenced this issue Sep 25, 2020
Documentation related to [dotnet/efcore #22559](dotnet/efcore#22559). May address [dotnet/efore #10963](dotnet/efcore#10963).
@codemillmatt
Copy link

@bpitppg - the sample's been updated in this PR

You can ignore anything that deals with the interpreter.

Instead set the iOS linker to Don't Link for the device release configuration. (As per: http://docs.microsoft.com/xamarin/ios/deploy-test/linker)

Let me know if that works for you or not.

@tomasz-soltysik
Copy link

@codemillmatt Thanks, this has fixed our issue. (I'm working with @bpitppg)

@JeremyLikness
Copy link
Member

Fixed per @lion92pl

@tomasz-soltysik
Copy link

@JeremyLikness I was just writing when you have closed this issue.
Unfortunately setting linker behavior to Don't link causes app upload to App Store to fail.
As stated in Publishing Xamarin.iOS apps to the App Store:

Using the Don't Link option can cause Apple to reject the app due to the presence of non-public iOS APIs in Xamarin.iOS that would be linked out with the Link Framework SDKs only option

I have tried changing back to Link framework SDK's only and adding --linkskip System.Core to Additional mtouch arguments. And that is what fixed this for us. App is working fine and Apple has accepted this build.

@JeremyLikness
Copy link
Member

The latest merge has the guidance you mentioned.

@tomasz-soltysik
Copy link

The latest merge has the guidance you mentioned.

I know, that from where I took this. But it still mentions setting linker behavior to Don't link as a second option. Might be worth adding comment, that this might cause Apple to reject build.

@ajcvickers ajcvickers added closed-no-further-action The issue is closed and no further action is planned. and removed area-adonet-sqlite labels Oct 20, 2020
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported
Projects
None yet
Development

No branches or pull requests

5 participants