Getting Multiple Dex Files error while Building in Eclipse

147 views
Skip to first unread message

Pankaj Jakhar

unread,
May 22, 2014, 9:19:47 AM5/22/14
to mobile-c...@googlegroups.com
I have downloaded latest CBLite1.0.0 build jars from Couchbase site but now when I have included them in my existing project replacing beta2 libraries I am getting this build error.

Unable to execute dex: Multiple dex files define Lcom/couchbase/lite/android/AndroidContext

What is the cause of problem? I have also extracted 
cbl_collator_so-1.0.0
and added three folders from it in my project's libs directory. - armeabi, armeabi-v7a, mips, x86

Can you please make it clear what is the issue and what is the solution?

Traun Leyden

unread,
May 27, 2014, 11:37:52 AM5/27/14
to mobile-c...@googlegroups.com
That sounds like you may have "old jars" mixed with "new jars".

Can you create a project from scratch and follow the instructions here?


Do you still see the error in that case?




--
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/77617d43-38ad-44a2-bf5d-f726f7f2960f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pankaj Jakhar

unread,
May 28, 2014, 2:39:30 AM5/28/14
to mobile-c...@googlegroups.com
I have tried with those steps  but now the error message has changed.

05-28 11:54:43.670: E/AndroidRuntime(5581): FATAL EXCEPTION: Thread-444
05-28 11:54:43.670: E/AndroidRuntime(5581): java.lang.ExceptionInInitializerError
05-28 11:54:43.670: E/AndroidRuntime(5581): at com.couchbase.android.CouchbaseService$2.run(CouchbaseService.java:229)
05-28 11:54:43.670: E/AndroidRuntime(5581): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load beam from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.innotion.protean-2.apk,libraryPath=/data/app-lib/com.innotion.protean-2]: findLibrary returned null
05-28 11:54:43.670: E/AndroidRuntime(5581): at java.lang.Runtime.loadLibrary(Runtime.java:365)
05-28 11:54:43.670: E/AndroidRuntime(5581): at java.lang.System.loadLibrary(System.java:535)
05-28 11:54:43.670: E/AndroidRuntime(5581): at com.couchbase.android.ErlangThread.<clinit>(ErlangThread.java:78)

I googled it and found it Unsatisfied Link Error.

What to do now? If you can provide me a jar using Android NDK which would fix this issue?

Traun Leyden

unread,
May 28, 2014, 11:21:37 AM5/28/14
to mobile-c...@googlegroups.com

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load beam from loader 

"beam" is related to the Erlang virtual machine

com.couchbase.android.CouchbaseService

This class is from https://github.com/couchbase/Android-Couchbase/blob/master/src/com/couchbase/android/CouchbaseService.java

Looks like you're using a deprecated project which is no longer supported and you should switch to https://github.com/couchbase/couchbase-lite-android 




Pankaj Jakhar

unread,
May 28, 2014, 11:40:51 AM5/28/14
to mobile-c...@googlegroups.com
I am using CouchDB and CBLite on Android Device - 1. CBLite - to index data and to serve it faster(Only pull replication) 2. CouchDB - to both pull/push documents to CouchDB running on server. Using two DBs on Mobile platform is actually a work around for the attachments issue of CouchDB on server side.

So, using Ektorp APIs with CBLite is the cause of issue? Or something else? What should I do to resolve it?

Traun Leyden

unread,
May 28, 2014, 11:48:46 AM5/28/14
to mobile-c...@googlegroups.com
Oh yeah I remember the discussion regarding that workaround.

I don't know what's causing that error.

I think the best fix is to get the CouchDB attachment incompatibility issue fixed, which is tripping up lots of users.  I will try to bump the priority on that.


Pankaj Jakhar

unread,
May 28, 2014, 11:52:38 AM5/28/14
to mobile-c...@googlegroups.com
Yes, Please do the favor. Make it a critical priority issue. Using CouchDB with CBLite is degrading the performance of well designed product. CBLite works really fast but when I do query CouchDB for something, it takes time.



PankaJ Jakhar

There Is No Secret Ingredient. It’s Just You.



--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/cxIRTupPsOg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/CACSSHCHKS3sdDkX6eFQ208dbneFSE%2BHS98%2BCSw18ruJ9tSqFtw%40mail.gmail.com.

Traun Leyden

unread,
Jun 2, 2014, 10:55:50 AM6/2/14
to mobile-c...@googlegroups.com
Good news!  The Couchbase Lite Android <-> CouchDB attachment issue has been fixed:



Pankaj Jakhar

unread,
Jun 3, 2014, 1:55:42 AM6/3/14
to mobile-c...@googlegroups.com
Hi Traun

Can you please provide me latest build with this fix? 

Traun Leyden

unread,
Jun 3, 2014, 2:45:17 PM6/3/14
to mobile-c...@googlegroups.com
Here are the latest builds from the master branch.

Zipfile  


Maven artifacts

Artifact ID:

compile 'com.couchbase.lite:couchbase-lite-android:0.0.0-395'



PRASANNA KUMAR

unread,
Jun 4, 2014, 6:05:21 AM6/4/14
to mobile-c...@googlegroups.com
Hi Traun,

is there any latest libraries for eclipse?(fixed this issue) .I Have been working one project where i am using eclipse previously i got libraries from here for eclipse.How we can get the latest libraries for eclipse.

could i get help or any suggestions

Thank's

prasanna

Traun Leyden

unread,
Jun 4, 2014, 11:05:19 AM6/4/14
to mobile-c...@googlegroups.com

Pankaj Jakhar

unread,
Jun 5, 2014, 12:17:46 PM6/5/14
to mobile-c...@googlegroups.com
Hi Traun

Can you please provide me the sample code to attach files to a document with this new fix?

Traun Leyden

unread,
Jun 5, 2014, 1:53:21 PM6/5/14
to mobile-c...@googlegroups.com

Pankaj Jakhar

unread,
Jun 5, 2014, 2:04:07 PM6/5/14
to mobile-c...@googlegroups.com
Thank you, Traun.

I am going to test it against CouchDB tomorrow with the build that you provided.



PankaJ Jakhar

There Is No Secret Ingredient. It’s Just You.



Pankaj Jakhar

unread,
Jun 6, 2014, 5:38:52 AM6/6/14
to mobile-c...@googlegroups.com
Hi Traun

I am using CBLite Libraries - couchbase-lite-0.0.0-395-android-community.zip provided by you to test it to push attachments against couchdb. I am still unable to push a document revision which has attachment in it.

As you said, it is still not pushing documents to CouchDB server. Only the revision with attachments gets missing from CouchDB server. All other revisions are pushed on the server except the ones which contain attachments.

Sample code:
                        Document document = mDatabase.getDocument(id);

                                                UnsavedRevision unsavedRevision;

try {
unsavedRevision = document.getCurrentRevision().createRevision();
unsavedRevision.setAttachment(file.getName(), contentType, inputStream);
unsavedRevision.save();
} catch (CouchbaseLiteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchbase+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/cxIRTupPsOg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchbase+unsubscribe@googlegroups.com.

PRASANNA KUMAR

unread,
Jun 9, 2014, 10:04:36 AM6/9/14
to mobile-c...@googlegroups.com
Hi Pankaj,

u can take latest jar file which is working for me
I hope which would u help u.

--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/cxIRTupPsOg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages