React-native-webrtc: [1.67.0][Android] Error on Building, Java 8 Compat

Created on 21 Aug 2018  路  5Comments  路  Source: react-native-webrtc/react-native-webrtc

I keep getting this error when trying to build the latest version.

Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8

I know Jack is deprecated on Android, but I can't get it to work.

I'm using default versions of Gradle for RN56
[email protected], [email protected], [email protected],

Added the compileOptions as the docs say

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

Which should support Java 8 expressions. Any ideas?

All 5 comments

@8BallBomBom Sorry to tag you, but you have been working with this version and might have some idea. Thanks!

What i'd suggest is trying to upgrade your gradle build tools to 3.1.3 also edit /android/gradle/wrapper/gradle-wrapper.properties distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Here are both my build files.
https://pastebin.com/S8CLkpBp
https://pastebin.com/5zbyEyZE

You can get some idea as to what my config is like which is currently working.
I would also say use the other react gradle file mentioned in here but i think RN 0.56 already includes that.
This will also mean there will be a build warning/complaint about compile being deprecated by the end of 2018 so you'll need to change things to use implementation instead.

That worked. Thanks a lot

@saghul Should we include some notes on the documentation to point this should be also done? I can help on that making some small guide using @8BallBomBom information.

@cristiantx Sure thing, thank would be most welcome!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vuquangthinh picture vuquangthinh  路  3Comments

idibidiart picture idibidiart  路  3Comments

tommynordli picture tommynordli  路  4Comments

micahalcorn picture micahalcorn  路  4Comments

szymonzmyslony picture szymonzmyslony  路  7Comments