Xamarin-macios: EntityFrameworkCore 3 prevents building on both device & simulator

Created on 2 Oct 2019  路  10Comments  路  Source: xamarin/xamarin-macios

Steps to Reproduce

  1. Open the demo project
  2. Try to build it

Expected Behavior

The build succeeds.

Actual Behavior

The build fails both for device & simulator

Environment

Microsoft Visual Studio Enterprise 2019
Version 16.3.2
VisualStudio.16.Release/16.3.2+29326.143
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Enterprise

Application Insights Tools for Visual Studio Package 9.1.00913.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019 16.3.283.64955
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.3.283.64955
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.3.283.64955
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.3.283.64955
Azure Functions and Web Jobs Tools

C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20816.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.0.83+gbc8a4b23ec
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Mono Debugging for Visual Studio 16.3.7 (9d260c5)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension 1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.61908.27190
Microsoft SQL Server Data Tools

TypeScript Tools 16.0.10821.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.3.0.274 (d16-3@06531f8)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.3.0.246 (remotes/origin/d16-3@bd2f86892)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.3.565 (27e9746)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.0.0.43 (d16-3/8af1ca8)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: mono/mono/2019-06@7af64d1ebe9
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333

Xamarin.iOS and Xamarin.Mac SDK 13.2.0.42 (5e8a208)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Build Logs

Here is the device build error:
ios_device_errors.txt

And here the simulator error:
ios_simulator_errors.txt

Example Project

TestEFC3XamarinApp.zip

bug iOS need-info

Most helpful comment

@Kistelekig98 I caught it!
If we have Hot Reload enabled (which requires --interpreter mtouch argument to be set), then the app crashes on launch. I have raised another issue.
Here it is - https://github.com/xamarin/xamarin-macios/issues/7484

@chamons You can close this now then. :)

All 10 comments

I'm hitting a different error with stable:

/Users/donblas/Downloads/TestEFC3XamarinApp/TestEFC3XamarinApp/TestEFC3XamarinApp.iOS/MTOUCH: Error MT5214: Native linking failed, undefined symbol: _sqlite3_key_v2. This symbol was referenced by the managed member SQLitePCL.SQLite3Provider_internal/NativeMethods.sqlite3_key_v2. Please verify that all the necessary frameworks have been referenced and native libraries linked. (MT5214) (TestEFC3XamarinApp.iOS)
/Users/donblas/Downloads/TestEFC3XamarinApp/TestEFC3XamarinApp/TestEFC3XamarinApp.iOS/clang: Error: linker command failed with exit code 1 (use -v to see invocation) (TestEFC3XamarinApp.iOS)
/Users/donblas/Downloads/TestEFC3XamarinApp/TestEFC3XamarinApp/TestEFC3XamarinApp.iOS/MTOUCH: Error MT5214: Native linking failed, undefined symbol: _sqlite3_rekey_v2. This symbol was referenced by the managed member SQLitePCL.SQLite3Provider_internal/NativeMethods.sqlite3_rekey_v2. Please verify that all the necessary frameworks have been referenced and native libraries linked. (MT5214) (TestEFC3XamarinApp.iOS)
/Users/donblas/Downloads/TestEFC3XamarinApp/TestEFC3XamarinApp/TestEFC3XamarinApp.iOS/MTOUCH: Error MT5202: Native linking failed. Please review the build log. (MT5202) (TestEFC3XamarinApp.iOS)

If this is related to NetStandard 2.1 however, we have a fix in the next service release. You can see if this fixes your issue by installing:

https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/d16-3/61bc89808746f23e562e87e58a6ffac991c03bc0/46/package/notarized/xamarin.ios-13.2.0.48.pkg

and reporting back.

@chamons
I have just tried with the latest stable from today - VS 16.3.3 with Xamarin.iOS 13.2.0.47
The issue persists.

I updated to VS 16.3.4 and Xamarin.iOS 13.4.0.2, and still have exactly the same issue as @chamons

Visual studio 16.4.0 Preview 2.0 with Xamarin.iOS 13.8.1.1 - the issue still persists

@chamons Any updates on this? I still can't get it to work, even with the latest preview.

@mduchev The problem was caused by a bug of the SQLitePCLRaw.bundle_e_sqlite3 nuget package , and after the 2.0.2 update it was fixed :) You need to download te latest version in every project, where you use Entity Framework (and EF will use this version).

Oh, I see - I missed the 2.0.2 release (I lastly saw the 2.0.1). I have just tried it and it works perfectly. We can close this then? :)

@mduchev Yes, in my opinion :)

Unfortunately, the project builds but I still cannot run it - I am having another issue now:

error: Microsoft.EntityFrameworkCore.Metadata.Internal.Model:FindIsOwnedConfigurationSource (System.Type): CEE_RET: value type stack: 16 vs. 8

Here is the stack trace + the native stack trace.
errors.txt

I will try to create a sample project, since this is another issue.

@Kistelekig98 I caught it!
If we have Hot Reload enabled (which requires --interpreter mtouch argument to be set), then the app crashes on launch. I have raised another issue.
Here it is - https://github.com/xamarin/xamarin-macios/issues/7484

@chamons You can close this now then. :)

Was this page helpful?
0 / 5 - 0 ratings