React-native-webrtc: Android build fails on a fresh react-native init project

Created on 31 Aug 2018  路  2Comments  路  Source: react-native-webrtc/react-native-webrtc

Expected behavior

Successful build

Observerd behavior

:WebRTCModule:javaPreCompileRelease
:WebRTCModule:compileReleaseJavaWithJavac
:WebRTCModule:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/eerokuusi/Documents/Coding/courtiusgroup/frontends/bigscreeninit/node_modules/react-native-webrtc/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java:46: error: cannot find symbol
ThreadUtils.runOnExecutor(() -> initAsync());
^
symbol: method metafactory(Lookup,String,MethodType,MethodType,MethodHandle,MethodType)
location: interface LambdaMetafactory
Fatal Error: Unable to find method metafactory
:WebRTCModule:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

Steps to reproduce the problem

1) react-native init a fresh install
2) yarn add react-native-webrtc
3) follow the Android installation instructions at https://github.com/oney/react-native-webrtc/blob/master/Documentation/AndroidInstallation.md

In the installation process I had to add

defaultConfig {
        ...
        jackOptions {
            enabled true
        }
    }

To enable building for older Java, which got rid of a previous error. The current error however I don't know how to handle.

4) react-native run-android

Platform information

  • React Native version: 0.56.0
  • Plugin version: 1.67.1
  • OS: Android
  • OS version: 7.1.2

Most helpful comment

@ekuusi You need to compile using Java 8 since newer versions of WebRTC requires that.
You can follow the instructions in pull request https://github.com/oney/react-native-webrtc/pull/508 (step 5)
hopefully getting merged soon.

All 2 comments

@ekuusi You need to compile using Java 8 since newer versions of WebRTC requires that.
You can follow the instructions in pull request https://github.com/oney/react-native-webrtc/pull/508 (step 5)
hopefully getting merged soon.

Thank you, works like a charm!

Was this page helpful?
0 / 5 - 0 ratings