SQLitePCL.raw icon indicating copy to clipboard operation
SQLitePCL.raw copied to clipboard

Failed to resolve System.String SQLitePCL.raw::sqlite3_column_name(SQLitePCL.sqlite3_stmt,System.Int32)

Open jan-rucka opened this issue 6 years ago • 13 comments

Xamarin.Forms, using Microsoft.Azure.Mobile.Client.SQLiteStore, version 4.1.1 and SQLitePCLRaw.core version 2.0.0, build in Release mode causes exception:

error MSB4018: Mono.Linker.MarkException: Error processing method: 'Newtonsoft.Json.Linq.JObject Microsoft.WindowsAzure.MobileServices.SQLiteStore.MobileServiceSQLiteStore::ReadRow(Microsoft.WindowsAzure.MobileServices.SQLiteStore.TableDefinition,SQLitePCL.sqlite3_stmt)' in assembly: 'Microsoft.Azure.Mobile.Client.SQLiteStore.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.String SQLitePCL.raw::sqlite3_column_name(SQLitePCL.sqlite3_stmt,System.Int32) [/Users/vsts/agent/2.155.1/work/1/s/ScsNtClient/Client.Droid/Client.Droid.csproj]

jan-rucka avatar Aug 30 '19 10:08 jan-rucka

SQLitePCLRaw 2.x is not compatible with Azure Mobile Apps. You should stay with 1.1.14.

ericsink avatar Aug 30 '19 13:08 ericsink

Hello Eric,

thanx for your answer, but in our solution we use following packages

SQLitePCLRaw.provider.e_sqlite3 SQLitePCLRaw.provider.dynamic_cdecl

these packages have no version 1.1.14 available in nuget.org repo anymore, and they have dependency set to SQLitePCLRaw.core (>= 2.0.0)

Any suggestion?

jan-rucka avatar Aug 30 '19 13:08 jan-rucka

Those probably showed up when you tried to upgrade SQLitePCLRaw to 2.0. Those packages IDs were new in 2.0 and never existed as part of 1.1.14.

(That probably means you are using packages.config -- life is much better if you get rid of that and switch to PackageReference, which handles transitive dependencies much better.)

Assuming you have some kind of version control, you should diff your packages.config file against the version before you tried to upgrade SQLitePCLRaw to 2.0.

ericsink avatar Aug 30 '19 13:08 ericsink

I just removed SQLitePCLRaw.provider.e_sqlite3 and SQLitePCLRaw.provider.dynamic_cdecl from solution, then downgraded SQLitePCLRaw.bundle_green to version 1.1.14 and during build I got following

Can not resolve reference: SQLitePCLRaw.provider.e_sqlite3, referenced by SQLitePCLRaw.batteries_green. Please add a NuGet package or assembly reference for SQLitePCLRaw.provider.e_sqlite3, or remove the reference to SQLitePCLRaw.batteries_green. Client.Droid

I wanted to add SQLitePCLRaw.provider.e_sqlite3 again but in repo is only version 2.x, which requires SQLitePCLRaw.core 2.x, which is not compatible with Microsoft.Azure.Mobile.Client.SQLiteStore

jan-rucka avatar Aug 30 '19 14:08 jan-rucka

Was this working before you tried upgrading SQLitePCLRaw to 2.0? You just need to get back to that state.

One option is to remove all the SQLitePCLRaw packages and the Azure mobile apps packages and then re-add the Azure Mobile App package, and it will add just the dependencies it needs.

If you post your packages.config file here I can take a look at it.

ericsink avatar Aug 30 '19 15:08 ericsink

thanks for answer, I'll get back to this issue next week, then I'll let you know

jan-rucka avatar Aug 30 '19 15:08 jan-rucka

@ericsink Any idea when the dependency will be updated? and thank you for the solution! I saw the other post about the current contributor falling off.

lazmeister avatar Sep 11 '19 15:09 lazmeister

@lazmeister Can you make that question more specific? Which dependency?

ericsink avatar Sep 11 '19 15:09 ericsink

@lazmeister Can you make that question more specific? Which dependency?

Sorry, this might pertain to Azure mobile client dependency. We were getting link assemblies error until we downgraded to 1.1.14 SQLitePCLRaw packages.

lazmeister avatar Sep 11 '19 16:09 lazmeister

Ah, yes. I rather doubt that Azure Mobile Apps will be updated for compatibility with SQLitePCLRaw 2.x. I have gotten the impression that the Azure Mobile Apps libraries are no longer being actively developed.

See the README on their main page:

https://github.com/Azure/azure-mobile-apps

ericsink avatar Sep 11 '19 16:09 ericsink

Yes sadly. Thank you anyway

lazmeister avatar Sep 11 '19 16:09 lazmeister

I encountered this issue also in a Windows Console app after updating SQLitePCLRaw.bundle_green to v2.0.2. Downgrading to v1.1.14 installed a bunch of other packages and produced other errors. Creating a new Windows Console app and upgrading to v1.1.14 cleared up all errors and work great. Does this mean that I should not upgrade the SQLite packages beyond v1.1.14?

tebo02 avatar Feb 12 '20 17:02 tebo02

@tebo02 I can't answer that question without more info. What packages got installed? What errors? etc.

Version 2.x contained some breaking changes from 1.1.14, so the upgrade does need to be done carefully in many cases.

ericsink avatar Feb 13 '20 16:02 ericsink

Closing old/stale issue.

ericsink avatar Sep 22 '22 21:09 ericsink