@hideki Problem! With the new 1.3 version, I cannot deploy my app to device. It builds the project fine, but trying to build & deploy the apk produces errors (as follows) basically that it doesn’t like the fact the the new version was compiled with Java 8. It took me a few hours until I realized that CBL was the culprit.
Although the Android build script suggest trying to set ‘compatibility to 1.7’, it did not help.
I tried this back and forth a few times, With 1.2.1 it works ok, with the new 1.3 it does this:
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the ‘java’ gradle plugin in a library submodule add
targetCompatibility = ‘1.7’
sourceCompatibility = ‘1.7’
to that submodule’s build.gradle file.
:app:transformClassesWithDexForDebug FAILED
Error:1 error; aborting
Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’.
com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\opt\jdk1.8.0_25\bin\java.exe’’ finished with non-zero exit value 1
— end quote ----
Now truth be told, possibly I am not including that 1.7 setting in the correct place, but I did try numerous ways based on googling StackOverflow, to no avail. Maybe you can tell me exactly where to include the 1.7 clause. Other than that, I’m back to 1.2.1
For Android N, we switched to use JDK 1.8 on the build server. Some of our community users already started to use developer preview version of CBL Android 1.3.0. However, I have never heard this issue till today.
Off the bat (am not at my developer console now) I can say that on my end I do NOT have SDK and Tools versions (compileSdkVersion 24 buildToolsVersion “24.0.0”) at 24. I have them set at 23 (due to a Studio Gui designer bug when its at 24) for projects and dependencies. Since I am not targeting “N”, version 23 is just fine for me. I’m afraid though that I cannot test with it at 24, because I have many many dependent projects and libs which all have to be set at the same version for it to build smoothly.
@hideki, Of course [it point to 1.2.1]. I told you that I had to change it to 1.2.1 in order to work!
But that exact file, if you change the 1.2.1 to 1.3.0, it bombs.
@hideki@pasin
UPDATE ON THIS PROBLEM:
But first, I am using Android Studio 2.1.2, and although I cannot get the ide itself to use jdk 8 for its own code, I was able to tell it to use jdk 8 for my CB lite projects. Also I changed my target Android version (of this and all dependent projects) to android sdk 24.
My error message has changed pointing to a specific bug in forestdb, as follows.: Error:PARSE ERROR: Error:unsupported class file version 52.0 Error:...while parsing com/couchbase/cbforest/Constants.class Error:1 error; aborting :app:transformClassesWithDexForDebug FAILED
So, I commented out the forestdb, as follows: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:24.0.0' compile 'com.couchbase.lite:couchbase-lite-android:+' //<-------- This line works! //compile 'com.couchbase.lite:couchbase-lite-java-forestdb:+' <----- This line commented out. }
With this configuration, I now CAN deploy a 1.3.0 CBL app. But of course without forestdb.