Couchbase lite EE java 2.8 + support for android versions

Hello every one,
I’m new to Couchbase and I have beed looking Ito the peer-to-peer feature.
Like mentioned in here from verion 2.8 there is a vast support in peer-to-peer. connection over IP.
I have been following the guidelines and even looked at the pre-mature Android Example Project because I’m. having some problems with building my app with the following dependency - implementation ‘com.couchbase.lite:couchbase-lite-android-ee:2.8.1’.

Is there some. documentation on the minimum supported Android/sdk/jdk versions?
If the example project mentioned is the minimal configuration it means I cannot implement it in my app.

I did saw in the first post I mentioned by @priya.rajagopal that older versions (2.6. and below? also not very clear) do support peer-to-peer connection with some additional bootstrapping.
Is there any code example for that? is this also supported. only in the Enterprise version ?

Please advise.

What is the exact error that you are seeing ? Share the output…

What steps did you follow you follow to build your app? Here are the instructions

Yes. It’s the very first thing In our “Start here” section!

Peer-to-Peer functionality is Enterprise only…even the pre 2.8 version of it. If you are new to couchbase, I would recommend setting up your app and get it up and running without peer-to-peer. Then follows the documentation on how to enable peer to peer. As you will learn from the doc steps, its couple of lines of code to get it working. So if you are seeing issues, then you are probably stumped with just getting the app going with couchbase lite.

Thanks for the prompt response, and your questions - they got me focused on the real problem.

I’m having a problem with building my app while adding both Enterprise and/orCommunity editions of Couchbase Lite SDK 2.8.1
I have forgot to mention that I have both Kotlin and Java in my code base .

The compilation error is related to my Kotlin code - Most of the errors are of kind

  • ‘map((T) -> R): List’ is only available since Kotlin 1.3.50 and cannot be used in Kotlin 1.3
  • ‘any((T) -> Boolean): Boolean’ is only available since Kotlin 1.3.50 and cannot be used in Kotlin 1.3

Once I downgrade to version 2.7.1 (both for the community and the enterprise editions) or remove the dependency completely from Gradle the problem is solved. So I don’t. really think it is related to my Kotlin version which works ok without Couchbase…

I have followed the steps here and manage to build versions 2.7.1 and below

I have configured the repositories section with
maven { url ‘https://mobile.maven.couchbase.com/maven2/dev/’ }
And the android section with
kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() }

I’m using Android Studio 4.4.1
Android Gradle Plugin version = 3.3.2
Gradle Version = 5.6.4
NDK=17
compileSdkVersion = 29
minSdkVersion = 23
targetSdkVersion = 29

I agree about your suggestion of first get. my app running with Couchbase this is why I’m trying to get your help here (:

Best,
Daniel

Hey I wanted to say that I took a deeper look into the code base and I found the problem.
I did have to migrate to Kotlin 1.3.50 - But It is weird though that integrating Couchbase. version 2.8.1 caused the compiler to go crazy…
After I migrated to 1.3.5 everything was fixed - Maybe it worth. mentioning in the. docs? although again - as far as I know. - the SDK is purely Java. - right? maybe some other more updated. Java version then then in 2.7.1?

Best,
Daniel

Cool- glad to know it worked.

hmm…sort of. The platform bindings layer is Java but underneath that bindings layer, there is a Lite core C/C++ layer that handles storage/ replication/query etc. (Also, FFR CBL is more than “SDK” … at a high level, think of it as a combination of platform bindings “SDK” + lite core database/storage layer)

What were the exact errors and in what versions of CBL caused this issue? You mentioned 2.8.1 but you mentioned “2.7.1” as well…

Thanks for the reply once more.
While working with CBL 2.7.1. and below. (both community and ent editions) everything worked well.

When I updated CBL from 2.7.1 to 2.8.1 the Kotlin errors popped.
So the following errors were showing when I was trying to use 2.8.1

  • ‘map((T) -> R): List’ is only available since Kotlin 1.3.50 and cannot be used in Kotlin 1.3
  • ‘any((T) -> Boolean): Boolean’ is only available since Kotlin 1.3.50 and cannot be used in Kotlin 1.3

I found myself upgrading the whole project. Kotlin 1.3.50 and that what resolved the issue.
What’s weird to me is the fact that only upgrading. from 2.7.1. to 2.8.1 caused the errors to show and not before…

In anyway you can see this issue as solved - thanks for the explanations and support

Thanks for the details.

Tagging @blake.meike

(CC @ibsoln for documentation update)

I’d like to see the compiler output.

There’s no Kotlin code in the the Java product, so I’m a little mystified as to why a change in the library would cause an error.

hey @blake.meikeand thanks for the answer, I’m also. wondering about it.
Attached some error examples thatI got. in previous messages here in the thread - they were many -hence I don’t attach all, they were of kind:

  • ‘map((T) -> R): List’ is only available since Kotlin 1.3.50 and cannot be used in Kotlin 1.3
  • ‘any((T) -> Boolean): Boolean’ is only available since Kotlin 1.3.50 and cannot be used in Kotlin 1.3

I have configured the repositories section with
maven { url ‘https://mobile.maven.couchbase.com/maven2/dev/’ }
And the android section with
kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() }

I’m using Android Studio 4.4.1
Android Gradle Plugin version = 3.3.2
Gradle Version = 5.6.4
NDK=17
compileSdkVersion = 29
minSdkVersion = 23
targetSdkVersion = 29

After I migrated the project to Kotlin 1.3.50 the errors were solved, yet like mentioned
The errors appeared only when I migrated from 2.7.1 ->2.8.1
Also rollingback. to 2.7.1 solved the compilation errors…

Please let me know if there is any other information I can add…

@danibachar… I wold need to see the compiler output to figure out what is going on. Our code should not be using any kotlin.

If you can give me source to compile that produces the error, that would be great. If not I’ll need the compiler log