fix: android build issue. (#521)

This commit is contained in:
Jojo Feng
2025-06-28 23:29:00 -07:00
committed by GitHub
parent d3b01b97fd
commit 1c87d741cb
12 changed files with 54 additions and 46 deletions

1
.gitignore vendored
View File

@@ -44,3 +44,4 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
/android/build/reports

View File

@@ -31,11 +31,15 @@ if (keystorePropertiesFile.exists()) {
android {
compileSdkVersion 34
namespace "com.jiaqifeng.hacki"
compileSdkVersion 35
ndkVersion = "27.0.12077973"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
}
kotlinOptions {
@@ -48,8 +52,8 @@ android {
defaultConfig {
applicationId "com.jiaqifeng.hacki"
minSdkVersion 25
targetSdkVersion 34
minSdkVersion 30
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
@@ -78,7 +82,8 @@ flutter {
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
}
ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]

View File

@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
kotlin.jvm.target.validation.mode = IGNORE

View File

@@ -1,6 +1,7 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

View File

@@ -18,8 +18,8 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
id "com.android.application" version "8.11.0" apply false
id "org.jetbrains.kotlin.android" version "2.2.0" apply false
}
include ":app"

View File

@@ -25,6 +25,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
namespace "dev.britannio.in_app_review"
compileSdkVersion 31
compileOptions {

View File

@@ -30,10 +30,10 @@ PODS:
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- qr_code_scanner (0.2.0):
- qr_code_scanner_plus (0.2.6):
- Flutter
- MTBBarcodeScanner
- receive_sharing_intent (1.5.3):
- receive_sharing_intent (1.8.1):
- Flutter
- share_plus (0.0.1):
- Flutter
@@ -68,7 +68,7 @@ DEPENDENCIES:
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- qr_code_scanner_plus (from `.symlinks/plugins/qr_code_scanner_plus/ios`)
- receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
@@ -109,8 +109,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
qr_code_scanner:
:path: ".symlinks/plugins/qr_code_scanner/ios"
qr_code_scanner_plus:
:path: ".symlinks/plugins/qr_code_scanner_plus/ios"
receive_sharing_intent:
:path: ".symlinks/plugins/receive_sharing_intent/ios"
share_plus:
@@ -145,8 +145,8 @@ SPEC CHECKSUMS:
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
receive_sharing_intent: 753f808c6be5550247f6a20f2a14972466a5f33c
qr_code_scanner_plus: 3bfe4deb7f28996a63a2a580819d49dae80d5ed3
receive_sharing_intent: 79c848f5b045674ad60b9fea3bafea59962ad2c1
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
@@ -158,4 +158,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: f03c7c11cf2b623592c89c68c628682778bb78b4
COCOAPODS: 1.16.2
COCOAPODS: 1.15.2

View File

@@ -36,7 +36,8 @@ class HomeScreen extends StatefulWidget {
class _HomeScreenState extends State<HomeScreen>
with SingleTickerProviderStateMixin, RouteAware, ItemActionMixin, Loggable {
late final TabController tabController;
late final StreamSubscription<String> intentDataStreamSubscription;
late final StreamSubscription<List<SharedMediaFile>>
intentDataStreamSubscription;
late final StreamSubscription<String?> notificationStreamSubscription;
late final StreamSubscription<String?> siriSuggestionStreamSubscription;
@@ -59,10 +60,13 @@ class _HomeScreenState extends State<HomeScreen>
void initState() {
super.initState();
ReceiveSharingIntent.getInitialText().then(onShareExtensionTapped);
ReceiveSharingIntent.instance
.getInitialMedia()
.then(onShareExtensionTapped);
intentDataStreamSubscription =
ReceiveSharingIntent.getTextStream().listen(onShareExtensionTapped);
intentDataStreamSubscription = ReceiveSharingIntent.instance
.getMediaStream()
.listen(onShareExtensionTapped);
if (!selectNotificationSubject.hasListener) {
notificationStreamSubscription =
@@ -222,12 +226,12 @@ class _HomeScreenState extends State<HomeScreen>
}
}
void onShareExtensionTapped(String? event) {
void onShareExtensionTapped(List<SharedMediaFile>? event) {
logInfo('share intent received: $event');
if (event == null) return;
final int? id = event.itemId;
final int? id = event.firstOrNull?.path.itemId;
if (id != null) {
locator.get<HackerNewsRepository>().fetchItem(id: id).then((Item? item) {

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hacki/styles/styles.dart';
import 'package:qr_code_scanner/qr_code_scanner.dart';
import 'package:qr_code_scanner_plus/qr_code_scanner_plus.dart';
class QrCodeScannerScreen extends StatefulWidget {
const QrCodeScannerScreen({super.key});
@@ -64,10 +64,4 @@ class _QrCodeScannerScreenState extends State<QrCodeScannerScreen> {
}
});
}
@override
void dispose() {
controller?.dispose();
super.dispose();
}
}

View File

@@ -447,10 +447,10 @@ packages:
dependency: "direct main"
description:
name: flutter_local_notifications
sha256: b94a50aabbe56ef254f95f3be75640f99120429f0a153b2dc30143cffc9bfdf3
sha256: edae0c34573233ab03f5ba1f07465e55c384743893042cb19e010b4ee8541c12
url: "https://pub.dev"
source: hosted
version: "19.2.1"
version: "19.3.0"
flutter_local_notifications_linux:
dependency: transitive
description:
@@ -463,10 +463,10 @@ packages:
dependency: transitive
description:
name: flutter_local_notifications_platform_interface
sha256: "2569b973fc9d1f63a37410a9f7c1c552081226c597190cb359ef5d5762d1631c"
sha256: "277d25d960c15674ce78ca97f57d0bae2ee401c844b6ac80fcd972a9c99d09fe"
url: "https://pub.dev"
source: hosted
version: "9.0.0"
version: "9.1.0"
flutter_local_notifications_windows:
dependency: transitive
description:
@@ -1032,14 +1032,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.2"
qr_code_scanner:
qr_code_scanner_plus:
dependency: "direct main"
description:
name: qr_code_scanner
sha256: f23b68d893505a424f0bd2e324ebea71ed88465d572d26bb8d2e78a4749591fd
name: qr_code_scanner_plus
sha256: "39696b50d277097ee4d90d4292de36f38c66213a4f5216a06b2bdd2b63117859"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "2.0.10+1"
qr_flutter:
dependency: "direct main"
description:
@@ -1052,10 +1052,10 @@ packages:
dependency: "direct main"
description:
name: receive_sharing_intent
sha256: a5f662546fbbd63d990401d90e7627740a1e4e0e16a7d64a12f6623662b1bcd9
sha256: ec76056e4d258ad708e76d85591d933678625318e411564dcb9059048ca3a593
url: "https://pub.dev"
source: hosted
version: "1.5.3"
version: "1.8.1"
responsive_builder:
dependency: "direct main"
description:
@@ -1646,4 +1646,4 @@ packages:
version: "3.1.3"
sdks:
dart: ">=3.8.0 <4.0.0"
flutter: ">=3.32.4"
flutter: ">=3.32.5"

View File

@@ -1,11 +1,11 @@
name: hacki
description: A Hacker News reader.
version: 2.10.0+156
version: 2.11.0+157
publish_to: none
environment:
sdk: ">=3.0.0 <4.0.0"
flutter: "3.32.4"
flutter: "3.32.5"
dependencies:
adaptive_theme: ^3.2.0
@@ -30,7 +30,7 @@ dependencies:
flutter_fadein: ^2.0.0
flutter_feather_icons: 2.0.0+1
flutter_inappwebview: ^6.1.5
flutter_local_notifications: ^19.2.1
flutter_local_notifications: ^19.3.0
flutter_material_color_picker: ^1.2.0
flutter_native_splash: ^2.4.4
flutter_secure_storage: ^9.2.4
@@ -62,9 +62,9 @@ dependencies:
git:
url: https://github.com/livinglist/flutter_pulltorefresh
ref: master
qr_code_scanner: ^1.0.1
qr_code_scanner_plus: ^2.0.10+1
qr_flutter: ^4.1.0
receive_sharing_intent: 1.5.3
receive_sharing_intent: 1.8.1
responsive_builder: ^0.7.0
rxdart: ^0.28.0
scrollable_positioned_list: ^0.3.5