Problem
I recently upgraded my ReactNative WebRTC version from "1.58.3" to "1.67.1" which causes my app to fail when building or even running it. The exact error I encountered is:D8: Invoke-customs are only supported starting with Android O (--min-api 26)
D8: Static interface methods are only supported starting with Android N (--min-api 24): org.webrtc.EglBase org.webrtc.EglBase.create()
Solution
1. In your project root directory go to "android/app/" and open the file build.gradle2. Copy and paste the code below within the android config.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Example:
Build you react native app again and it should work.