1

I'm working on a iOS project that needs FTS on a SQLite DB.

I've followed the instructions found on the web concerning the building of a custom version of SQLite, together with a user function to order the results of a FTS by relevance, and built it all with XCode, setting a new Static library target and obtaining a libSQLite.a as output.

On iOS everything works ok! The FTS, the relevance order, etc.

Now there is the need to port everything on MonoTouch. I've followed the instructions to use the libSQLite.a built from XCode in the MonoDevelop project, found at How to use FTS in SQLite with Monotouch for iOS

In particular, I wrote a SQLite wrapper in C# for the library thanks to the tutorial found at http://www.switchonthecode.com/tutorials/csharp-tutorial-writing-a-dotnet-wrapper-for-sqlite

I also changed the references to the .dll with __Internal as the SO Question said, but still I can't understand why it doesn't work.

The application starts and immediately crashes, even if I don't call any method of the SQLite class.

The code just stops at window.MakeKeyAndVisible();

This is the error:

Stacktrace:

at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes (System.Reflection.Assembly,bool) at System.Reflection.Assembly.GetTypes () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/Assembly.cs:348 at MonoTouch.ObjCRuntime.Runtime.RegisterAssembly (System.Reflection.Assembly) [0x0004b] in /Users/plasma/Source/iphone/monotouch/ObjCRuntime/Runtime.cs:82 at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr)

Native stacktrace:

0   SQLiteFTSTest                       0x000d1965 mono_handle_native_sigsegv + 343
1   SQLiteFTSTest                       0x0000ffb4 mono_sigsegv_signal_handler + 322
2   libSystem.B.dylib                   0x980e845b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   ???                                 0x077586fe 0x0 + 125142782
5   ???                                 0x077586c1 0x0 + 125142721Error connecting stdout and stderr (127.0.0.1:10001)

6   ???                                 0x0774df29 0x0 + 125099817
7   ???                                 0x0774e055 0x0 + 125100117
8   SQLiteFTSTest                       0x0000fd6f mono_jit_runtime_invoke + 1332
9   SQLiteFTSTest                       0x001ee239 mono_runtime_invoke + 137
10  SQLiteFTSTest                       0x0029bc55 monotouch_register + 90
11  SQLiteFTSTest                       0x002a24d7 main + 3562
12  SQLiteFTSTest                       0x000030c9 _start + 208
13  SQLiteFTSTest                       0x00002ff8 start + 40
14  ???                                 0x00000002 0x0 + 2

Debug info from gdb:

/tmp/mono-gdb-commands.A3ljfK:1: Error in sourced command file: unable to debug self

What should I do?

Community
  • 1
  • 1
Vik
  • 1,897
  • 12
  • 18
  • The lack of a diagnostics error in this case sounds like a bug in MonoTouch. Would you be so kind to prepare a self-contained test case that we can try on our end, and look at providing a better error message? Once we know what the problem is, we can tell you how to fix it (and ensure MonoTouch tells other developers what the problem is) Please use bugzilla.xamarin.com to file your bug. – miguel.de.icaza Jul 19 '11 at 20:22

0 Answers0