Skip to content

Commit 1c87d74

Browse files
authored
fix: android build issue. (#521)
1 parent d3b01b9 commit 1c87d74

File tree

12 files changed

+54
-46
lines changed

12 files changed

+54
-46
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ app.*.map.json
4444
/android/app/debug
4545
/android/app/profile
4646
/android/app/release
47+
/android/build/reports

android/app/build.gradle

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@ if (keystorePropertiesFile.exists()) {
3131

3232

3333
android {
34-
compileSdkVersion 34
34+
namespace "com.jiaqifeng.hacki"
35+
compileSdkVersion 35
36+
ndkVersion = "27.0.12077973"
3537

3638
compileOptions {
3739
sourceCompatibility JavaVersion.VERSION_1_8
3840
targetCompatibility JavaVersion.VERSION_1_8
41+
// Flag to enable support for the new language APIs
42+
coreLibraryDesugaringEnabled true
3943
}
4044

4145
kotlinOptions {
@@ -48,8 +52,8 @@ android {
4852

4953
defaultConfig {
5054
applicationId "com.jiaqifeng.hacki"
51-
minSdkVersion 25
52-
targetSdkVersion 34
55+
minSdkVersion 30
56+
targetSdkVersion 35
5357
versionCode flutterVersionCode.toInteger()
5458
versionName flutterVersionName
5559
}
@@ -78,7 +82,8 @@ flutter {
7882
}
7983

8084
dependencies {
81-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0"
85+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20"
86+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
8287
}
8388

8489
ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]

android/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
22
android.useAndroidX=true
33
android.enableJetifier=true
4+
kotlin.jvm.target.validation.mode = IGNORE

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

android/settings.gradle

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

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "7.3.0" apply false
22-
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
21+
id "com.android.application" version "8.11.0" apply false
22+
id "org.jetbrains.kotlin.android" version "2.2.0" apply false
2323
}
2424

2525
include ":app"

components/in_app_review/android/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ apply plugin: 'com.android.library'
2525
apply plugin: 'kotlin-android'
2626

2727
android {
28+
namespace "dev.britannio.in_app_review"
29+
2830
compileSdkVersion 31
2931

3032
compileOptions {

ios/Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ PODS:
3030
- path_provider_foundation (0.0.1):
3131
- Flutter
3232
- FlutterMacOS
33-
- qr_code_scanner (0.2.0):
33+
- qr_code_scanner_plus (0.2.6):
3434
- Flutter
3535
- MTBBarcodeScanner
36-
- receive_sharing_intent (1.5.3):
36+
- receive_sharing_intent (1.8.1):
3737
- Flutter
3838
- share_plus (0.0.1):
3939
- Flutter
@@ -68,7 +68,7 @@ DEPENDENCIES:
6868
- integration_test (from `.symlinks/plugins/integration_test/ios`)
6969
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
7070
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
71-
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
71+
- qr_code_scanner_plus (from `.symlinks/plugins/qr_code_scanner_plus/ios`)
7272
- receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`)
7373
- share_plus (from `.symlinks/plugins/share_plus/ios`)
7474
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
@@ -109,8 +109,8 @@ EXTERNAL SOURCES:
109109
:path: ".symlinks/plugins/package_info_plus/ios"
110110
path_provider_foundation:
111111
:path: ".symlinks/plugins/path_provider_foundation/darwin"
112-
qr_code_scanner:
113-
:path: ".symlinks/plugins/qr_code_scanner/ios"
112+
qr_code_scanner_plus:
113+
:path: ".symlinks/plugins/qr_code_scanner_plus/ios"
114114
receive_sharing_intent:
115115
:path: ".symlinks/plugins/receive_sharing_intent/ios"
116116
share_plus:
@@ -145,8 +145,8 @@ SPEC CHECKSUMS:
145145
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
146146
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
147147
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
148-
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
149-
receive_sharing_intent: 753f808c6be5550247f6a20f2a14972466a5f33c
148+
qr_code_scanner_plus: 3bfe4deb7f28996a63a2a580819d49dae80d5ed3
149+
receive_sharing_intent: 79c848f5b045674ad60b9fea3bafea59962ad2c1
150150
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
151151
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
152152
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
@@ -158,4 +158,4 @@ SPEC CHECKSUMS:
158158

159159
PODFILE CHECKSUM: f03c7c11cf2b623592c89c68c628682778bb78b4
160160

161-
COCOAPODS: 1.16.2
161+
COCOAPODS: 1.15.2

lib/screens/home/home_screen.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ class HomeScreen extends StatefulWidget {
3636
class _HomeScreenState extends State<HomeScreen>
3737
with SingleTickerProviderStateMixin, RouteAware, ItemActionMixin, Loggable {
3838
late final TabController tabController;
39-
late final StreamSubscription<String> intentDataStreamSubscription;
39+
late final StreamSubscription<List<SharedMediaFile>>
40+
intentDataStreamSubscription;
4041
late final StreamSubscription<String?> notificationStreamSubscription;
4142
late final StreamSubscription<String?> siriSuggestionStreamSubscription;
4243

@@ -59,10 +60,13 @@ class _HomeScreenState extends State<HomeScreen>
5960
void initState() {
6061
super.initState();
6162

62-
ReceiveSharingIntent.getInitialText().then(onShareExtensionTapped);
63+
ReceiveSharingIntent.instance
64+
.getInitialMedia()
65+
.then(onShareExtensionTapped);
6366

64-
intentDataStreamSubscription =
65-
ReceiveSharingIntent.getTextStream().listen(onShareExtensionTapped);
67+
intentDataStreamSubscription = ReceiveSharingIntent.instance
68+
.getMediaStream()
69+
.listen(onShareExtensionTapped);
6670

6771
if (!selectNotificationSubject.hasListener) {
6872
notificationStreamSubscription =
@@ -222,12 +226,12 @@ class _HomeScreenState extends State<HomeScreen>
222226
}
223227
}
224228

225-
void onShareExtensionTapped(String? event) {
229+
void onShareExtensionTapped(List<SharedMediaFile>? event) {
226230
logInfo('share intent received: $event');
227231

228232
if (event == null) return;
229233

230-
final int? id = event.itemId;
234+
final int? id = event.firstOrNull?.path.itemId;
231235

232236
if (id != null) {
233237
locator.get<HackerNewsRepository>().fetchItem(id: id).then((Item? item) {

lib/screens/profile/qr_code_scanner_screen.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:go_router/go_router.dart';
33
import 'package:hacki/styles/styles.dart';
4-
import 'package:qr_code_scanner/qr_code_scanner.dart';
4+
import 'package:qr_code_scanner_plus/qr_code_scanner_plus.dart';
55

66
class QrCodeScannerScreen extends StatefulWidget {
77
const QrCodeScannerScreen({super.key});
@@ -64,10 +64,4 @@ class _QrCodeScannerScreenState extends State<QrCodeScannerScreen> {
6464
}
6565
});
6666
}
67-
68-
@override
69-
void dispose() {
70-
controller?.dispose();
71-
super.dispose();
72-
}
7367
}

pubspec.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,10 @@ packages:
447447
dependency: "direct main"
448448
description:
449449
name: flutter_local_notifications
450-
sha256: b94a50aabbe56ef254f95f3be75640f99120429f0a153b2dc30143cffc9bfdf3
450+
sha256: edae0c34573233ab03f5ba1f07465e55c384743893042cb19e010b4ee8541c12
451451
url: "https://pub.dev"
452452
source: hosted
453-
version: "19.2.1"
453+
version: "19.3.0"
454454
flutter_local_notifications_linux:
455455
dependency: transitive
456456
description:
@@ -463,10 +463,10 @@ packages:
463463
dependency: transitive
464464
description:
465465
name: flutter_local_notifications_platform_interface
466-
sha256: "2569b973fc9d1f63a37410a9f7c1c552081226c597190cb359ef5d5762d1631c"
466+
sha256: "277d25d960c15674ce78ca97f57d0bae2ee401c844b6ac80fcd972a9c99d09fe"
467467
url: "https://pub.dev"
468468
source: hosted
469-
version: "9.0.0"
469+
version: "9.1.0"
470470
flutter_local_notifications_windows:
471471
dependency: transitive
472472
description:
@@ -1032,14 +1032,14 @@ packages:
10321032
url: "https://pub.dev"
10331033
source: hosted
10341034
version: "3.0.2"
1035-
qr_code_scanner:
1035+
qr_code_scanner_plus:
10361036
dependency: "direct main"
10371037
description:
1038-
name: qr_code_scanner
1039-
sha256: f23b68d893505a424f0bd2e324ebea71ed88465d572d26bb8d2e78a4749591fd
1038+
name: qr_code_scanner_plus
1039+
sha256: "39696b50d277097ee4d90d4292de36f38c66213a4f5216a06b2bdd2b63117859"
10401040
url: "https://pub.dev"
10411041
source: hosted
1042-
version: "1.0.1"
1042+
version: "2.0.10+1"
10431043
qr_flutter:
10441044
dependency: "direct main"
10451045
description:
@@ -1052,10 +1052,10 @@ packages:
10521052
dependency: "direct main"
10531053
description:
10541054
name: receive_sharing_intent
1055-
sha256: a5f662546fbbd63d990401d90e7627740a1e4e0e16a7d64a12f6623662b1bcd9
1055+
sha256: ec76056e4d258ad708e76d85591d933678625318e411564dcb9059048ca3a593
10561056
url: "https://pub.dev"
10571057
source: hosted
1058-
version: "1.5.3"
1058+
version: "1.8.1"
10591059
responsive_builder:
10601060
dependency: "direct main"
10611061
description:
@@ -1646,4 +1646,4 @@ packages:
16461646
version: "3.1.3"
16471647
sdks:
16481648
dart: ">=3.8.0 <4.0.0"
1649-
flutter: ">=3.32.4"
1649+
flutter: ">=3.32.5"

0 commit comments

Comments
 (0)