Skip to content

Commit 3fe33a5

Browse files
Upgraded protobuf to v3 and upgraded the android example to fix the deprecated imperative apply of gradle plugins (#871)
1 parent 9d7f0a0 commit 3fe33a5

File tree

13 files changed

+874
-621
lines changed

13 files changed

+874
-621
lines changed

example/android/app/build.gradle

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

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-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,10 +22,6 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
android {
2926
compileSdkVersion 33
3027

@@ -65,8 +62,4 @@ android {
6562

6663
flutter {
6764
source '../..'
68-
}
69-
70-
dependencies {
71-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7265
}

example/android/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.8.21'
3-
repositories {
4-
mavenCentral()
5-
google()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:8.0.2'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()

example/android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
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+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

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

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"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "8.0.2" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.21" apply false
23+
}
24+
25+
include ":app"

example/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ SPEC CHECKSUMS:
3030

3131
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011
3232

33-
COCOAPODS: 1.14.3
33+
COCOAPODS: 1.15.2

example/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,10 @@ packages:
430430
dependency: transitive
431431
description:
432432
name: protobuf
433-
sha256: "01dd9bd0fa02548bf2ceee13545d4a0ec6046459d847b6b061d8a27237108a08"
433+
sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d"
434434
url: "https://pub.dev"
435435
source: hosted
436-
version: "2.1.0"
436+
version: "3.1.0"
437437
provider:
438438
dependency: "direct main"
439439
description:

packages/flutter_reactive_ble/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,10 @@ packages:
407407
dependency: transitive
408408
description:
409409
name: protobuf
410-
sha256: "01dd9bd0fa02548bf2ceee13545d4a0ec6046459d847b6b061d8a27237108a08"
410+
sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d"
411411
url: "https://pub.dev"
412412
source: hosted
413-
version: "2.1.0"
413+
version: "3.1.0"
414414
pub_semver:
415415
dependency: transitive
416416
description:

0 commit comments

Comments
 (0)