Couchbase testing on Android Emulator

Dear Team,

When test my app in Android Emulator (SDK version 21), I am getting SQLiteConnectionException.mConnectionPtr not found.

Should I do any additional stuff for emulator…?

Regards,
Ravi

Hello Ravi,

Would you be able to post some code and give more context? (e.g. How are you testing your app, when are you seeing the issue you are reporting, etc)
Also seems like the ‘offset_db_handle’ is returning ‘NULL’:

https://github.com/couchbase/couchbase-lite-android/blob/master/src/main/jni/JsonCollator/com_couchbase_touchdb_TDCollateJSON.cpp#L486

How are you creating your database?

Dear William Hoang,

I have upload the sample codes in google drive. You can download from following link.
https://drive.google.com/file/d/0Bx7nKp1pf4tIMk5lVGVTcWRlV2s/edit?usp=sharing

The uploaded code is working fine in the device, but throwing exception while testing using emulator.

My virtual device configuration is attached in the uploaded zip file.

I using eclipse luna and Windows 8.1. Also using HAX in ADT (virtualization) for emulator.

Regards,
Ravi

Note: if you are not able to access the above link, please let me know the alternate way to share codes with you.

Dear William Hoang,

Are you able to check my codes…?

Regards,
Ravi

Hello Ravi,

Apologies for the delay. I am using Android Studio 0.8.9 with HAX enabled on MAC. I am not getting the same errors as you reported, how are you testing? No compile time issues but RT exceptions are:

09-30 00:19:04.401 1905-1905/com.sample.schooly E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.sample.schooly, PID: 1905
java.lang.NullPointerException
at com.sample.schooly.views.EventsFragment.callbackHandle(EventsFragment.java:50)
at com.sample.schooly.views.EventsFragment$1.onCall(EventsFragment.java:38)
at com.sample.schooly.views.EventsFragment$1.onCall(EventsFragment.java:35)
at com.sample.schooly.controllers.Controller$EventTask.onPostExecute(Controller.java:154)
at com.sample.schooly.controllers.Controller$EventTask.onPostExecute(Controller.java:134)
at android.os.AsyncTask.finish(AsyncTask.java:632)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)

Have you been able to resolve the original issue? For your AVD, consider targeting API level to be Android 19 or below as Android L is still in preview. Believe testing on device would be the ultimate truth but do let me know of your progress and updates.

Best,
William

This sounds like a duplicate of https://github.com/couchbase/couchbase-lite-android/issues/373

Dear William,

The RT exception is due to the url of the service has been hard coded with the address of our local network. I am trying to start my development activity with android studio.

I will let you know if I face any problem with android studio for app using couchbase.

Regards,
Ravi

This should be fixed now.

See https://github.com/couchbase/couchbase-lite-android/issues/373