Environment Configuration
Turn on Java 8 support
You also need to turn on Java 8 support in application's build.gradle, by adding the following to the android section:
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Add Uses Permission
Add in app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Allow HTTP Request (Only required by HLS, DASH)
Starting with Android 9 (API level 28), cleartext support is disabled by default. There are 2 solutions: (1) set targetSdkVersion under 27 (2) Add the attribute below in app/src/main/AndroidManifest.xml to indicate that the app intends to use cleartext HTTP:
<application
...
android:usesCleartextTraffic="true"
...
/>
Proguard Configuration
Add the following code in proguard-rules.pro:
-dontwarn com.p2p.**
-keep class com.p2p.**{*;}
-keep interface com.p2p.**{*;}
-dontwarn org.webrtc.**
-keep class org.webrtc.**{*;}
Last updated
Was this helpful?