Training > Android - Can't find SQLiteConnection.mConnectionPtr

200 views
Skip to first unread message

Ersin Ertan

unread,
Dec 6, 2014, 2:55:24 PM12/6/14
to mobile-c...@googlegroups.com


Hey there,

I'm trying the Building your first Couchbase Lite Android app Training section, doing some copy-paste, and am hit with this error while following the guide.

Can't find SQLiteConnection.mConnectionPtr

because of this line

try{
database = manager.getDatabase(dbname);
com.couchbase.lite.util.Log.d(TAG, "Database created");
 }
 catch(com.couchbase.lite.CouchbaseLiteException e){
com.couchbase.lite.util.Log.e(TAG, "Cannot get database");
return;
 }
   }

Complete error:

12-06 14:31:43.873    2408-2408/com.test.couchbaselitenosqldb D/HelloWorld﹕ Manager created
12-06 14:33:40.343    2408-2408/com.test.couchbaselitenosqldb E/TDCollateJSON﹕ Can't find SQLiteConnection.mConnectionPtr
12-06 14:33:40.363    2408-2408/com.test.couchbaselitenosqldb D/AndroidRuntime﹕ Shutting down VM
12-06 14:34:02.043    2408-2408/com.test.couchbaselitenosqldb E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.test.couchbaselitenosqldb, PID: 2408
    java.lang.NoSuchFieldError: no "I" field "mConnectionPtr" in class "Landroid/database/sqlite/SQLiteConnection;" or its superclasses
            at com.couchbase.touchdb.TDCollateJSON.nativeRegisterCustomCollators(Native Method)
            at com.couchbase.touchdb.TDCollateJSON.registerCustomCollators(TDCollateJSON.java:11)
            at com.couchbase.lite.android.AndroidSQLiteStorageEngine.open(AndroidSQLiteStorageEngine.java:46)
            at com.couchbase.lite.Database.open(Database.java:911)
            at com.couchbase.lite.Manager.getDatabase(Manager.java:227)
            at com.test.couchbaselitenosqldb.MainActivity.initializeDatabase(MainActivity.java:48)
            at com.test.couchbaselitenosqldb.MainActivity.onCreate(MainActivity.java:19)
            at android.app.Activity.performCreate(Activity.java:5933)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

Any ideas as to what is going on?

Traun Leyden

unread,
Dec 6, 2014, 3:02:17 PM12/6/14
to mobile-c...@googlegroups.com
Looks like you are using an older version and hitting this issue:


Can you give me the direct link to the docs you are looking at so we can update it?

Also, let me know where you downloaded the couchbase lite binaries so I can make sure you are getting the latest version.

If you are using Android Studio, the easiest way to get the binaries is via Maven.  See the GrocerySync example app's build.gradle.

GrocerySync also some screencasts that walk you through building it.




--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/bcdb6b85-cecf-4231-84ec-f6b9c0a19bfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ersin Ertan

unread,
Dec 6, 2014, 3:12:02 PM12/6/14
to mobile-c...@googlegroups.com

Hiren Adesara

unread,
Jan 8, 2015, 2:16:52 AM1/8/15
to mobile-c...@googlegroups.com
I faced the same issue when I followed the tutorial on developer.couchbase.com site.It led me to the same page that Ersin mentioned: http://developer.couchbase.com/mobile/develop/training/build-first-android-app/get-started-studio/index.html#add-cbl-dependencies. Please update.

Traun Leyden

unread,
Jan 8, 2015, 10:29:16 AM1/8/15
to mobile-c...@googlegroups.com
Thanks.  I just fixed the document source, and it will go out to the website on the next push.

Mohammed Abdulwahhab

unread,
Jan 17, 2015, 7:16:20 PM1/17/15
to mobile-c...@googlegroups.com
 change the dependencies in the build.gradle file to this:

compile 'com.couchbase.lite:couchbase-lite-android:1.0.3.1'
Reply all
Reply to author
Forward
0 new messages