Impossible to add SQLiteNetExtensions like a reference
Hi,
I start a new project "test" to try behavior of the extension. I join in this issue what looks like my solution.
It's very very basic, a new android project, a shared project. I include SQLite into android project from NuGet package and added sqlite extension from a dll.
When I try to build this solution, I obtain an error, which is :
#!/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'SQLite.Net, Version=2.2.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'SQLite.Net.dll'
at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00000] in <filename unknown>:0
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences (System.Collections.Generic.List`1 assemblies, Mono.Cecil.AssemblyDefinition assembly, Boolean topLevel) [0x00000] in <filename unknown>:0
at Xamarin.Android.Tasks.ResolveAssemblies.Execute () [0x00000] in <filename unknown>:0 (TestSqlite)
If you see in this error, he doesn't found an assembly SQLite.Net v. 2.2.0.0, but I use the lastest version, v. 1.0.8.
Do you know how to correct my problem ?
Thank you.
Comments (9)
-
-
reporter Yes I know. In the readme, he specify to use sqlite-net (source or NuGet package), and use the dll. That's what I do.
I start a new question in stackoverflow, if someone can help me Here
-
Hey David,
It seems that SQLite-Net Extensions is not using the latest SQLite-Net PCL NuGet package. The last version is 2.3.0 where the precompiled DLL is linked against 2.2.0, so you can re-compile SQLite-Net Extensions with the new SQLite-Net PCL or you can use the 2.2.0 version of SQLite-Net PCL.
-
reporter I download your repo in order to build and generate dll. So I found three dlls generated : - SQLite - SQLiteNetExtensions - Newtonsoft.Json
I put these three dlls into my PCL project. But I still have an error when build my project :
#!/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.5/Microsoft.Common.targets: Error: Error executing task ResolveAssemblyReference: Could not load file or assembly '/Users/David/Developments/ContAACt/app_compagnon_xamarin/Contaact.Core.MD/bin/Debug/SQLite.Net.dll' or one of its dependencies. The system cannot find the file specified. (Contaact.Core.MD)
-
You only need to add SQLiteNetExtensions.dll. The other DLLs can be added as NuGet packages. I'm already working in creating a NuGet package that will make everything much easier.
-
reporter I do like you send. I add SQLite-net PCL into my Android Library Project from NuGet Package. I download and build your project, I copy from bin/debug/SQLiteNetExtensions.dll into my project Xamarin.
But, always an error :
#!/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Perhaps it doesn't exist in the Mono for Android profile? File name: 'Newtonsoft.Json.dll' at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00000] in <filename unknown>:0 at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences (System.Collections.Generic.List`1 assemblies, Mono.Cecil.AssemblyDefinition assembly, Boolean topLevel) [0x00000] in <filename unknown>:0 at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences (System.Collections.Generic.List`1 assemblies, Mono.Cecil.AssemblyDefinition assembly, Boolean topLevel) [0x00000] in <filename unknown>:0 at Xamarin.Android.Tasks.ResolveAssemblies.Execute () [0x00000] in <filename unknown>:0 (Contaact.Android)
-
Hey David. I just created the NuGet package that will hopefully solve all these issues. Can you give it a try? https://www.nuget.org/packages/SQLiteNetExtensions
-
reporter Oh yay !
I install Extensions from NuGet package. I look into my packages.config and I see that you automatically install newtonsoft.json v6.0.3 too.
I build my solution and found no error.
Really thank you from all ContAACt's dev team !!
-
- changed status to resolved
- Log in to comment
It's looking for an assembly but you've pulled in the sqlite-net source.