davidliu
Committed by GitHub

Fix build issues (#403)

1 [versions] 1 [versions]
2 webrtc = "114.5735.08" 2 webrtc = "114.5735.08"
  3 +leakcanaryAndroid = "2.8.1"
  4 +preferenceKtx = "1.2.1"
3 5
4 androidJainSipRi = "1.3.0-91" 6 androidJainSipRi = "1.3.0-91"
5 androidx-core = "1.10.1" 7 androidx-core = "1.10.1"
@@ -24,6 +26,8 @@ material = "1.11.0" @@ -24,6 +26,8 @@ material = "1.11.0"
24 [libraries] 26 [libraries]
25 android-jain-sip-ri = { module = "javax.sip:android-jain-sip-ri", version.ref = "androidJainSipRi" } 27 android-jain-sip-ri = { module = "javax.sip:android-jain-sip-ri", version.ref = "androidJainSipRi" }
26 androidx-core = { module = "androidx.core:core", version.ref = "androidx-core" } 28 androidx-core = { module = "androidx.core:core", version.ref = "androidx-core" }
  29 +androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
  30 +androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preferenceKtx" }
27 audioswitch = { module = "com.github.davidliu:audioswitch", version.ref = "audioswitch" } 31 audioswitch = { module = "com.github.davidliu:audioswitch", version.ref = "audioswitch" }
28 dagger-lib = { module = "com.google.dagger:dagger", version.ref = "dagger" } 32 dagger-lib = { module = "com.google.dagger:dagger", version.ref = "dagger" }
29 dagger-compiler = { module = "com.google.dagger:dagger-compiler", version.ref = "dagger" } 33 dagger-compiler = { module = "com.google.dagger:dagger-compiler", version.ref = "dagger" }
@@ -33,6 +37,7 @@ androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtim @@ -33,6 +37,7 @@ androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtim
33 androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx-lifecycle" } 37 androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx-lifecycle" }
34 androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" } 38 androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
35 kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } 39 kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
  40 +leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanaryAndroid" }
36 okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } 41 okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
37 protobuf-javalite = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobufJavalite" } 42 protobuf-javalite = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobufJavalite" }
38 semver4j = { module = "com.vdurmont:semver4j", version.ref = "semver4j" } 43 semver4j = { module = "com.vdurmont:semver4j", version.ref = "semver4j" }
@@ -72,7 +77,6 @@ mockito-inline = { module = "org.mockito:mockito-inline", version = "4.11.0" } @@ -72,7 +77,6 @@ mockito-inline = { module = "org.mockito:mockito-inline", version = "4.11.0" }
72 77
73 robolectric = { module = "org.robolectric:robolectric", version = "4.11.1" } 78 robolectric = { module = "org.robolectric:robolectric", version = "4.11.1" }
74 turbine = { module = "app.cash.turbine:turbine", version = "1.0.0" } 79 turbine = { module = "app.cash.turbine:turbine", version = "1.0.0" }
75 -core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }  
76 appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } 80 appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
77 material = { group = "com.google.android.material", name = "material", version.ref = "material" } 81 material = { group = "com.google.android.material", name = "material", version.ref = "material" }
78 82
@@ -8,6 +8,14 @@ java { @@ -8,6 +8,14 @@ java {
8 sourceCompatibility = java_version 8 sourceCompatibility = java_version
9 targetCompatibility = java_version 9 targetCompatibility = java_version
10 } 10 }
  11 +// From Gradle 8 onwards, Kapt no longer automatically picks up jvmTarget
  12 +// from normal KotlinOptions. Must be manually set.
  13 +// JvmToolchain should not be used since it changes the actual JDK used.
  14 +tasks.withType(org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile).configureEach {
  15 + kotlinOptions {
  16 + jvmTarget = java_version
  17 + }
  18 +}
11 compileKotlin { 19 compileKotlin {
12 kotlinOptions { 20 kotlinOptions {
13 jvmTarget = java_version 21 jvmTarget = java_version
@@ -252,7 +252,7 @@ class MediaTrackEqualsDetectorTest { @@ -252,7 +252,7 @@ class MediaTrackEqualsDetectorTest {
252 fun mediaStreamTrack(): TestFile { 252 fun mediaStreamTrack(): TestFile {
253 return java( 253 return java(
254 """ 254 """
255 - package livekit.org.webrtc.; 255 + package livekit.org.webrtc;
256 256
257 class MediaStreamTrack { 257 class MediaStreamTrack {
258 int getId(){ 258 int getId(){
@@ -5,12 +5,12 @@ plugins { @@ -5,12 +5,12 @@ plugins {
5 5
6 android { 6 android {
7 namespace 'io.livekit.android.sample.basic' 7 namespace 'io.livekit.android.sample.basic'
8 - compileSdk 33 8 + compileSdk 34
9 9
10 defaultConfig { 10 defaultConfig {
11 applicationId "io.livekit.android.sample.basic" 11 applicationId "io.livekit.android.sample.basic"
12 minSdk 21 12 minSdk 21
13 - targetSdk 33 13 + targetSdk 34
14 versionCode 1 14 versionCode 1
15 versionName "1.0" 15 versionName "1.0"
16 16
@@ -59,19 +59,19 @@ dependencies { @@ -59,19 +59,19 @@ dependencies {
59 // api "io.livekit:livekit-android:<version>" 59 // api "io.livekit:livekit-android:<version>"
60 api project(":livekit-android-sdk") 60 api project(":livekit-android-sdk")
61 61
62 - api "androidx.core:core-ktx:${libs.versions.androidx.core.get()}"  
63 - api 'androidx.appcompat:appcompat:1.4.0'  
64 - api 'com.google.android.material:material:1.4.0' 62 + api libs.androidx.core.ktx
  63 + api libs.appcompat
  64 + api libs.material
65 api libs.coroutines.lib 65 api libs.coroutines.lib
66 api libs.timber 66 api libs.timber
67 - api "androidx.lifecycle:lifecycle-runtime-ktx:${libs.versions.androidx.lifecycle.get()}"  
68 - api "androidx.lifecycle:lifecycle-viewmodel-ktx:${libs.versions.androidx.lifecycle.get()}"  
69 - api "androidx.lifecycle:lifecycle-common-java8:${libs.versions.androidx.lifecycle.get()}" 67 + api libs.androidx.lifecycle.runtime.ktx
  68 + api libs.androidx.lifecycle.viewmodel.ktx
  69 + api libs.androidx.lifecycle.common.java8
70 api libs.protobuf.javalite 70 api libs.protobuf.javalite
71 - api 'androidx.preference:preference-ktx:1.1.1' 71 + api libs.androidx.preference.ktx
72 // debugImplementation because LeakCanary should only run in debug builds. 72 // debugImplementation because LeakCanary should only run in debug builds.
73 - debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'  
74 - testImplementation 'junit:junit:4.+'  
75 - androidTestImplementation 'androidx.test.ext:junit:1.1.3'  
76 - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 73 + debugImplementation libs.leakcanary.android
  74 +
  75 + testImplementation libs.junit
  76 + androidTestImplementation libs.androidx.test.core
77 } 77 }
1 -package io.livekit.android.sample  
2 -  
3 -import androidx.test.ext.junit.runners.AndroidJUnit4  
4 -import androidx.test.platform.app.InstrumentationRegistry  
5 -import org.junit.Assert.*  
6 -import org.junit.Test  
7 -import org.junit.runner.RunWith  
8 -  
9 -/**  
10 - * Instrumented test, which will execute on an Android device.  
11 - *  
12 - * See [testing documentation](http://d.android.com/tools/testing).  
13 - */  
14 -@RunWith(AndroidJUnit4::class)  
15 -class ExampleInstrumentedTest {  
16 - @Test  
17 - fun useAppContext() {  
18 - // Context of the app under test.  
19 - val appContext = InstrumentationRegistry.getInstrumentation().targetContext  
20 - assertEquals("io.livekit.android.sample", appContext.packageName)  
21 - }  
22 -}