Compile Java for :react-native-twilio-video-webrtc:compileDebugJavaWithJavac
See original GitHub issueSteps to reproduce
Setup project for android:
-
Install package using yarn:
yarn add https://github.com/blackuy/react-native-twilio-video-webrtc
-
Add the library to settings.gradle:
include ':react-native-twilio-video-webrtc'
project(':react-native-twilio-video-webrtc').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-twilio-video-webrtc/android')

- Include the library in dependencies in android/app/build.gradle:
dependencies {
.....
.....
.....
implementation project(path: ':react-native-twilio-video-webrtc')
}

- Load the package in MainApplication.java:
import com.twiliorn.library.TwilioPackage;

- Update the getPackages() method in MainApplication.java:
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
...
new TwilioPackage()
);
}

- Add camera and audio permissions to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
- (Additional) Add these two lines to proguard-rules.pro:
-keep class org.webrtc.** { *; }
-keep class com.twilio.** { *; }
Expected behaviour
Build android project successfully
Actual behaviour
Compile fail
Environment
- Node.js version: 12.8.0
- React Native version: 0.60.5
- React Native platform + platform version: iOS 12.4, Android 9.0 API 28
react-native-twilio-video-webrtc
Version: 1.0.2
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (1 by maintainers)
I am getting a similar error, can you help please?
@YOEL311 you can use latest, just ensure you run ‘npx jetify’ after installing.