I tried again by using a Context that writes to 
`data/data/<android_application_id>/files` and it fixes the reason you 
outlined above.

But now another error occured which is probably related to reason 2:

08-26 11:35:24.581    1826-1826/com.couchbase.j2objcsampleandroidapp 
E/com.couchbase.lite﹕ Native: Library not found: 
/native/linux/i686/libCouchbaseLiteJavaNative.so
08-26 11:35:24.582    1826-1826/com.couchbase.j2objcsampleandroidapp 
E/com.couchbase.lite﹕ Native: Error loading library: CouchbaseLiteJavaNative
...
08-26 11:35:24.582    1826-1826/com.couchbase.j2objcsampleandroidapp E/art﹕ 
No implementation found for long 
com.couchbase.lite.storage.JavaSQLiteStorageEngine._open(java.lang.String) 
(tried Java_com_couchbase_lite_storage_JavaSQLiteStorageEngine__1open and 
Java_com_couchbase_lite_storage_JavaSQLiteStorageEngine__1open__Ljava_lang_String_2)

So it turns out that Couchbase Lite and J2ObjC aren't compatible but it was 
worth the time to investigate if it'd be possible.

James

On Wednesday, 26 August 2015 09:33:13 UTC+4, Hideki Itakura wrote:
>
> Hi @james,
>
> couchbase-lite-java does not run on Android.
>
> Reasons:
> 1. couchbase-lite-java contains Context class that may not work on 
> Android. 
> 2. couchbase-lite-java depends on couchbase-lite-java-native which 
> contains native SQLite and Collators which might work on Android even if 
> they are compiled for Android architecture.
>
> From the log message, I think reason 1 causes problem.
>
> Thanks,
> Hideki
>
> On Tuesday, August 25, 2015 at 9:35:33 PM UTC-7, James Nocentini wrote:
>>
>> I'm seeing the same error when using J2ObjC in the hope to write the 
>> models of an application with couchbase-lite-java and reuse them on iOS and 
>> Android with J2ObjC.
>>
>> I think the problem may come from the fact that I'm creating the 
>> couchbase lite manager in a pure java app but running on Android.
>>
>> @Erwan, you said the manager in your case was created using 
>> couchbase-lite-java-core. So it looks like the same probelm. Did you 
>> manager to solve the issue?
>>
>> @Hideki, I get the same error. `08-26 00:28:32.565   
>>  3599-3599/com.couchbase.j2objcsampleandroidapp 
>> W/System.err﹕java.io.IOException: Unable to create directory for: 
>> /data/data/com.couchbase.lite.test/files/cblite`.
>> I'm not sure why the test package `com.couchbase.lite.test` appears on 
>> that line in LogCat.
>>
>> James
>>
>> On Wednesday, 20 May 2015 06:57:23 UTC+4, Erwan Koffi wrote:
>>>
>>> Hello,
>>>
>>> I am currently trying to use couchbase lite for android while using 
>>> libgdx framework to have a fancy synchronized database between laptop and 
>>> phone. Unfortunatly, I'm getting one error.
>>>
>>> Couchbase lite version is 1.0.4-28.
>>>
>>> In my main build.gradle, I have:
>>>
>>> dependencies {
>>>     ...
>>>     compile "com.couchbase.lite:couchbase-lite-android:$couchbaseVersion"
>>> }
>>>
>>>
>>> For the android project:
>>>
>>> android {
>>>     buildToolsVersion "22.0.1"
>>>     compileSdkVersion 22
>>>     sourceSets {
>>>         main {
>>>             manifest.srcFile 'AndroidManifest.xml'
>>>             java.srcDirs = ['src']
>>>             aidl.srcDirs = ['src']
>>>             renderscript.srcDirs = ['src']
>>>             res.srcDirs = ['res']
>>>             assets.srcDirs = ['assets']
>>>         }
>>>
>>>         instrumentTest.setRoot('tests')
>>>     }
>>>
>>>     packagingOptions {
>>>         exclude 'META-INF/ASL2.0'
>>>         exclude 'META-INF/LICENSE'
>>>         exclude 'META-INF/NOTICE'
>>>     }
>>> }
>>>
>>>
>>> And finally my Manifest:
>>>
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <manifest xmlns:android="http://schemas.android.com/apk/res/android";
>>>     package="com.btsit.game.android"
>>>     android:versionCode="1"
>>>     android:versionName="1.0" >
>>>
>>>     <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="22" />
>>>
>>>     <application
>>>         android:allowBackup="true"
>>>         android:icon="@drawable/ic_launcher"
>>>         android:label="@string/app_name"
>>>         android:theme="@style/GdxTheme" >
>>>         <activity
>>>             android:name="com.btsit.game.android.AndroidLauncher"
>>>             android:label="@string/app_name" 
>>>             android:screenOrientation="landscape"
>>>             
>>> android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
>>>             <intent-filter>
>>>                 <action android:name="android.intent.action.MAIN" />
>>>                 <category android:name="android.intent.category.LAUNCHER" />
>>>             </intent-filter>
>>>         </activity>
>>>     </application>
>>>
>>> </manifest>
>>>
>>>
>>> When trying to create manager, I have an io exception:
>>>
>>>> Caused by: java.io.IOException: Unable to create directory for: 
>>>> /data/data/com.couchbase.lite.test/files/cblite
>>>>        at com.couchbase.lite.Manager.<init>(Manager.java:129)
>>>
>>>
>>> Context is retrieved in AndroidApplication with:
>>>
>>> new AndroidContext(this)
>>>
>>>
>>> Manager is created using couchbase-lite-java-core in an another project.
>>>
>>> This error may only occurs on simulator, as my testing phone is quite 
>>> old I can't test the app on it :(.
>>>
>>> Does someone have any idea?
>>>
>>

-- 
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/c364562a-0bbf-4624-b678-92fdaee1cd70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to