Ok, I found out what was the problem, it has nothing to do with the build tools, or the dev environment. I tried to init the Database in an Android Service. It's really strange, because I'm using the exact same context (Application Context), it should be running on the main thread, so I not see the difference between calling the init code in the Application's onCreate or a Services' onCreate method. I even tried to use a handler to post a Runnable and make sure that it's running on the main thread. In the SQLiteStorageEngineFactory there is a line:
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource); It returns null, maybe the issue related to how the Android class loader works. 2014-08-14 13:58 GMT-04:00 Traun Leyden <[email protected]>: > Can you try with TodoLite-Android > <https://github.com/couchbaselabs/ToDoLite-Android> and see if you get > the same error? > > The latest Android Studio I've tested with is 0.8.2. > > > > > On Thu, Aug 14, 2014 at 10:56 AM, Gyula Vörös <[email protected]> > wrote: > >> The environment is the following: >> >> IDE: Android Studio 0.8.6. >> Build tools: com.android.tools.build:gradle:0.12.+ >> Couchbase: compile group: 'com.couchbase.lite', name: >> 'couchbase-lite-android', version: '0.0.0-436' >> >> DB init code: >> final Manager manager = new Manager(new AndroidContext(context), >> Manager.DEFAULT_OPTIONS); >> final Database database = manager.getDatabase("myapp-db"); >> >> >> 2014-08-14 13:39 GMT-04:00 Traun Leyden <[email protected]>: >> >>> >>> Are you using Eclipse + maven artifacts? >>> >>> That's an untested configuration, so I'm not sure that it will work or >>> not. Can you try with Android Studio or are you required to use Eclipse? >>> >>> For Eclipse users, we are recommending a different approach to adding >>> the dependencies: >>> >>> >>> http://developer.couchbase.com/mobile/develop/training/build-first-android-app/get-started-eclipse/index.html >>> >>> >>> >>> >>> On Wed, Aug 13, 2014 at 8:31 PM, Gyula Vörös <[email protected]> >>> wrote: >>> >>>> Hey, >>>> >>>> Same here. Do you have any update? I tried with >>>> >>>> compile group: 'com.couchbase.lite', name: 'couchbase-lite-android', >>>> version: '0.0.0-436' >>>> & >>>> compile group: 'com.couchbase.lite', name: 'couchbase-lite-android', >>>> version: '1.0.1' >>>> >>>> no luck so far. >>>> >>>> I see the file in the projects build folder: >>>> /build/intermediates/exploded-aar/com.couchbase.lite/couchbase-lite-android/0.0.0-436/classes.jar!/services/com.couchbase.lite.storage.SQLiteStorageEngine, >>>> but get "Failed to load storage. Resource: >>>> services/com.couchbase.lite.storage.SQLiteStorageEngine classname:". >>>> >>>> 2014. augusztus 12., kedd 3:11:30 UTC-4 időpontban John Bibal III a >>>> következőt írta: >>>> >>>>> This happens when I try to initialize the Couchbase lite database. >>>>> >>>>> // create a new database >>>>> database = null; >>>>> try { >>>>> database = manager.getDatabase(DATABASE_NAME); >>>>> Log.d (TAG, "Database created"); >>>>> } catch (CouchbaseLiteException e) { >>>>> Log.e(TAG, "Cannot get database"); >>>>> return; >>>>> } >>>>> >>>> -- >>>> 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 [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/mobile-couchbase/a80e9300-fd6c-4148-8b09-00b50f5b9ac2%40googlegroups.com >>>> <https://groups.google.com/d/msgid/mobile-couchbase/a80e9300-fd6c-4148-8b09-00b50f5b9ac2%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >>> 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/I91La6UQ9Yg/unsubscribe >>> . >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/mobile-couchbase/CACSSHCGvz4UDJPHv6aX%3D_4LCFe5mKpgYXFzfkGnMKf4pxibGfA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/mobile-couchbase/CACSSHCGvz4UDJPHv6aX%3D_4LCFe5mKpgYXFzfkGnMKf4pxibGfA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/mobile-couchbase/CAPPnXdyJb2tGGVQWp-ea1oDOcUutZzjB%3DahjopLFxSnVby%2BcyQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/mobile-couchbase/CAPPnXdyJb2tGGVQWp-ea1oDOcUutZzjB%3DahjopLFxSnVby%2BcyQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- > 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/I91La6UQ9Yg/unsubscribe > . > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/mobile-couchbase/CACSSHCFMk4eNSyL2ayVpi-OVx6kNXntpFp0p8jmcqcscm11ezQ%40mail.gmail.com > <https://groups.google.com/d/msgid/mobile-couchbase/CACSSHCFMk4eNSyL2ayVpi-OVx6kNXntpFp0p8jmcqcscm11ezQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/CAPPnXdzZ1Ffc26HGCsy03%3DMuh1i1x_9%2BVuND9yoqxWCrmcb8Ow%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
