Skip to content

Commit 24363e2

Browse files
authored
feat(share_plus)!: Change Android compile SDK, update Android build config (#3671)
1 parent 01b596a commit 24363e2

File tree

6 files changed

+17
-22
lines changed

6 files changed

+17
-22
lines changed

packages/share_plus/share_plus/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ Sharing files is not supported on Linux.
3030
- Dart >=3.4.0 <4.0.0
3131
- iOS >=12.0
3232
- macOS >=10.14
33-
- Android `compileSDK` 34
3433
- Java 17
35-
- Android Gradle Plugin >=8.3.0
36-
- Gradle wrapper >=8.4
34+
- Kotlin 2.2.0
35+
- Android Gradle Plugin >=8.12.1
36+
- Gradle wrapper >=8.13
3737

3838
## Usage
3939

@@ -90,7 +90,7 @@ import 'package:cross_file/cross_file.dart';
9090
9191
final params = ShareParams(
9292
text: 'Great picture',
93-
files: [XFile('${directory.path}/image.jpg')],
93+
files: [XFile('${directory.path}/image.jpg')],
9494
);
9595
9696
final result = await SharePlus.instance.share(params);
@@ -106,7 +106,7 @@ import 'package:cross_file/cross_file.dart';
106106
107107
final params = ShareParams(
108108
files: [
109-
XFile('${directory.path}/image1.jpg'),
109+
XFile('${directory.path}/image1.jpg'),
110110
XFile('${directory.path}/image2.jpg'),
111111
],
112112
);
@@ -147,7 +147,7 @@ import 'package:cross_file/cross_file.dart';
147147
import 'dart:convert';
148148
149149
final params = ShareParams(
150-
files: [XFile.fromData(utf8.encode(text), mimeType: 'text/plain')],
150+
files: [XFile.fromData(utf8.encode(text), mimeType: 'text/plain')],
151151
fileNameOverrides: ['myfile.txt']
152152
);
153153

packages/share_plus/share_plus/android/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ group 'dev.fluttercommunity.plus.share'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
5-
ext.kotlin_version = '1.7.22'
5+
ext.kotlin_version = '2.2.0'
66
repositories {
77
google()
88
mavenCentral()
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:8.3.1'
12+
classpath 'com.android.tools.build:gradle:8.12.1'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
1515
}
@@ -25,9 +25,8 @@ apply plugin: 'com.android.library'
2525
apply plugin: 'kotlin-android'
2626

2727
android {
28-
compileSdk 34
29-
3028
namespace 'dev.fluttercommunity.plus.share'
29+
compileSdk = flutter.compileSdkVersion
3130

3231
compileOptions {
3332
sourceCompatibility JavaVersion.VERSION_17
@@ -49,7 +48,7 @@ android {
4948

5049
dependencies {
5150
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
52-
implementation 'androidx.core:core-ktx:1.13.1'
53-
implementation 'androidx.annotation:annotation:1.8.2'
51+
implementation 'androidx.core:core-ktx:1.16.0'
52+
implementation 'androidx.annotation:annotation:1.9.1'
5453
}
5554
}

packages/share_plus/share_plus/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/share_plus/share_plus/example/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (flutterVersionName == null) {
2222
}
2323

2424
android {
25-
compileSdk 34
25+
compileSdk = flutter.compileSdkVersion
2626

2727
namespace 'io.flutter.plugins.shareexample'
2828

@@ -37,8 +37,8 @@ android {
3737

3838
defaultConfig {
3939
applicationId "io.flutter.plugins.shareexample"
40-
minSdk 21
41-
targetSdk 34
40+
minSdk flutter.minSdkVersion
41+
targetSdk flutter.targetSdkVersion
4242
versionCode flutterVersionCode.toInteger()
4343
versionName flutterVersionName
4444
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
33
distributionPath=wrapper/dists
44
zipStorePath=wrapper/dists
55
zipStoreBase=GRADLE_USER_HOME

packages/share_plus/share_plus/example/android/settings.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "8.3.1" apply false
21+
id "com.android.application" version "8.12.1" apply false
22+
id "org.jetbrains.kotlin.android" version "2.2.0" apply false
2223
}
2324

2425
include ":app"

0 commit comments

Comments
 (0)