Skip to content

Commit 346f00c

Browse files
authored
Revert "Android AGP upgrade" (#651)
This reverts commit c3e4a1e.
1 parent c3e4a1e commit 346f00c

File tree

4 files changed

+39
-43
lines changed

4 files changed

+39
-43
lines changed

example/android/app/build.gradle

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
plugins {
2-
id "com.android.application"
3-
id "kotlin-android"
4-
id "dev.flutter.flutter-gradle-plugin"
5-
}
6-
71
def localProperties = new Properties()
82
def localPropertiesFile = rootProject.file('local.properties')
93
if (localPropertiesFile.exists()) {
@@ -12,6 +6,11 @@ if (localPropertiesFile.exists()) {
126
}
137
}
148

9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
1514
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1615
if (flutterVersionCode == null) {
1716
flutterVersionCode = '1'
@@ -22,27 +21,27 @@ if (flutterVersionName == null) {
2221
flutterVersionName = '1.0'
2322
}
2423

24+
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
26+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27+
2528
android {
26-
namespace 'io.livekit.example'
27-
compileSdk 34
29+
compileSdkVersion 34
2830

2931
sourceSets {
3032
main.java.srcDirs += 'src/main/kotlin'
3133
}
3234

33-
compileOptions {
34-
sourceCompatibility JavaVersion.VERSION_21
35-
targetCompatibility JavaVersion.VERSION_21
36-
}
37-
kotlinOptions {
38-
jvmTarget = JavaVersion.VERSION_21
39-
}
35+
// compileOptions {
36+
// sourceCompatibility JavaVersion.VERSION_1_8
37+
// targetCompatibility JavaVersion.VERSION_1_8
38+
// }
4039

4140
defaultConfig {
4241
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4342
applicationId "io.livekit.example"
44-
minSdk 21
45-
targetSdk 34
43+
minSdkVersion 21
44+
targetSdkVersion 34
4645
versionCode flutterVersionCode.toInteger()
4746
versionName flutterVersionName
4847
}

example/android/build.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1+
buildscript {
2+
ext.kotlin_version = '1.7.10'
3+
repositories {
4+
google()
5+
jcenter()
6+
}
7+
8+
dependencies {
9+
classpath 'com.android.tools.build:gradle:7.1.1'
10+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11+
}
12+
}
13+
114
allprojects {
2-
ext.kotlin_version = '2.0.21'
315
repositories {
416
google()
5-
mavenCentral()
17+
jcenter()
618
}
719
}
820

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip

example/android/settings.gradle

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
1-
pluginManagement {
2-
def flutterSdkPath = {
3-
def properties = new Properties()
4-
file("local.properties").withInputStream { properties.load(it) }
5-
def flutterSdkPath = properties.getProperty("flutter.sdk")
6-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7-
return flutterSdkPath
8-
}
9-
settings.ext.flutterSdkPath = flutterSdkPath()
1+
include ':app'
102

11-
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
3+
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4+
def properties = new Properties()
125

13-
repositories {
14-
google()
15-
mavenCentral()
16-
gradlePluginPortal()
17-
}
18-
}
6+
assert localPropertiesFile.exists()
7+
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
198

20-
plugins {
21-
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22-
id "com.android.application" version '8.7.2' apply false
23-
id "org.jetbrains.kotlin.android" version "2.0.21" apply false
24-
}
25-
26-
include ":app"
9+
def flutterSdkPath = properties.getProperty("flutter.sdk")
10+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11+
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

0 commit comments

Comments
 (0)