Skip to content

Commit 8003b0c

Browse files
committed
fix android issue
1 parent ade7a09 commit 8003b0c

File tree

6 files changed

+75
-57
lines changed

6 files changed

+75
-57
lines changed

android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ android {
6060
// Flag to enable support for the new language APIs
6161
coreLibraryDesugaringEnabled true
6262
// Sets Java compatibility to Java 8
63-
sourceCompatibility = 17
64-
targetCompatibility = 17
63+
sourceCompatibility = 1.8
64+
targetCompatibility = 1.8
6565
kotlinOptions {
66-
jvmTarget = "17"
66+
jvmTarget = "1.8"
6767
}
6868

6969
}
@@ -86,7 +86,7 @@ android {
8686
defaultConfig {
8787
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
8888
applicationId "com.kidozh.discuz_flutter"
89-
minSdkVersion 26
89+
minSdkVersion 30
9090
targetSdkVersion 34
9191
versionCode flutterVersionCode.toInteger()
9292
versionName flutterVersionName

android/build.gradle

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ buildscript {
33
google()
44
mavenCentral()
55
}
6-
ext.kotlin_version = '2.1.0'
6+
ext.kotlin_version = '1.9.22'
77
// ext {
88
// agp_version = '7.4.2'
99
// }
1010
dependencies {
1111
// START: FlutterFire Configuration
1212
classpath 'com.google.gms:google-services:4.3.15'
1313
// END: FlutterFire Configuration
14-
classpath 'com.android.tools.build:gradle:7.4.2'
14+
classpath 'com.android.tools.build:gradle:8.7.3'
1515
}
1616
}
1717

1818
allprojects {
19-
ext.kotlin_version = '1.8.10'
19+
// ext.kotlin_version = '1.8.10'
2020
repositories {
2121
google()
2222
mavenCentral()
@@ -40,7 +40,7 @@ rootProject.buildDir = '../build'
4040
subprojects {
4141
project.buildDir = "${rootProject.buildDir}/${project.name}"
4242

43-
afterEvaluate {
43+
afterEvaluate { project ->
4444
// check if android block is available
4545

4646
if (it.hasProperty('android')) {
@@ -52,25 +52,38 @@ subprojects {
5252
android.namespace = packageName
5353
}
5454

55-
// def javaVersion = JavaVersion.VERSION_17
56-
// android {
57-
// def androidApiVersion = 34
58-
// compileSdkVersion androidApiVersion
59-
// defaultConfig {
60-
// targetSdkVersion androidApiVersion
55+
// if (project.plugins.hasPlugin("com.android.application") ||
56+
// project.plugins.hasPlugin("com.android.library")) {
57+
// project.android {
58+
// compileSdkVersion 34
59+
// buildToolsVersion "34.0.0"
60+
//
6161
// }
62-
// compileOptions {
63-
// sourceCompatibility javaVersion
64-
// targetCompatibility javaVersion
62+
// project.android.defaultConfig{
63+
// minSdkVersion 30
64+
// //targetSdkVersion 34
6565
// }
66-
// tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
67-
// kotlinOptions {
68-
// jvmTarget = javaVersion.toString()
69-
// }
70-
// }
71-
// println("Setting java version to ${javaVersion.toString()} which is $javaVersion")
72-
// println("Setting compileSdkVersion and targetSdkVersion to $androidApiVersion")
7366
// }
67+
68+
def javaVersion = JavaVersion.VERSION_18
69+
android {
70+
def androidApiVersion = 34
71+
compileSdkVersion androidApiVersion
72+
defaultConfig {
73+
targetSdkVersion androidApiVersion
74+
}
75+
compileOptions {
76+
sourceCompatibility javaVersion
77+
targetCompatibility javaVersion
78+
}
79+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
80+
kotlinOptions {
81+
jvmTarget = javaVersion.toString()
82+
}
83+
}
84+
println("Setting java version to ${javaVersion.toString()} which is $javaVersion")
85+
println("Setting compileSdkVersion and targetSdkVersion to $androidApiVersion")
86+
}
7487
}
7588

7689
}

android/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ android.useAndroidX=true
33
android.enableJetifier=true
44
android.enableR8=true
55
kotlin.jvm.target.validation.mode = IGNORE
6+
android.jetifier.ignorelist=bcprov-jdk18on-1.78.1.jar
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

lib/utility/ToastUtils.dart

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import 'package:discuz_flutter/utility/AppPlatformIcons.dart';
44
import 'package:flutter/material.dart';
55
import 'package:flutter_easyloading/flutter_easyloading.dart';
6-
import 'package:toastification/toastification.dart';
76

87
class ToastUtils{
98
static Future<void> showSuccessfulToast(String msg) {
@@ -14,30 +13,30 @@ class ToastUtils{
1413

1514
}
1615

17-
static void showInfoToast(BuildContext context, String msg) {
18-
// EasyLoading.showSuccess(
19-
// msg,
20-
// );
21-
22-
toastification.show(context: context,
23-
title: Text(msg),
24-
style: ToastificationStyle.fillColored,
25-
autoCloseDuration: const Duration(seconds: 2),
26-
showProgressBar: false,
27-
type: ToastificationType.info,
28-
icon: Icon(AppPlatformIcons(context).check),
29-
alignment: Alignment.topCenter
30-
31-
32-
);
33-
}
34-
35-
static void showErrorToast(BuildContext context, String msg) {
36-
toastification.show(context: context,
37-
title: Text(msg),
38-
style: ToastificationStyle.fillColored,
39-
autoCloseDuration: const Duration(milliseconds: 500),
40-
type: ToastificationType.error
41-
);
42-
}
16+
// static void showInfoToast(BuildContext context, String msg) {
17+
// // EasyLoading.showSuccess(
18+
// // msg,
19+
// // );
20+
//
21+
// toastification.show(context: context,
22+
// title: Text(msg),
23+
// style: ToastificationStyle.fillColored,
24+
// autoCloseDuration: const Duration(seconds: 2),
25+
// showProgressBar: false,
26+
// type: ToastificationType.info,
27+
// icon: Icon(AppPlatformIcons(context).check),
28+
// alignment: Alignment.topCenter
29+
//
30+
//
31+
// );
32+
// }
33+
34+
// static void showErrorToast(BuildContext context, String msg) {
35+
// toastification.show(context: context,
36+
// title: Text(msg),
37+
// style: ToastificationStyle.fillColored,
38+
// autoCloseDuration: const Duration(milliseconds: 500),
39+
// type: ToastificationType.error
40+
// );
41+
// }
4342
}

pubspec.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ dependencies:
5353
permission_handler: ^11.0.0
5454
# open_file: ^3.2.1
5555
flutter_slidable:
56-
webview_cookie_manager: ^2.0.6
56+
webview_cookie_manager:
57+
git:
58+
url: https://github.com/fryette/webview_cookie_manager
59+
ref: 8572dd54c437c919aedc8dca6c5bffd25fe74b3
5760
intl: ^0.19.0
5861
flutter_platform_widgets: ^7.0.0
5962
flutter_launcher_icons: ^0.14.1
@@ -83,15 +86,17 @@ dependencies:
8386
google_mobile_ads: ^5.1.0
8487
dynamic_color: ^1.6.7
8588
intl_utils: ^2.8.1
86-
dual_screen: ^1.0.3
89+
dual_screen:
90+
git:
91+
url: https://github.com/mwdavis84/flutter-dualscreen
8792
carousel_slider: ^5.0.0
8893
upgrader: ^11.3.0
8994
flutter_secure_storage: ^9.0.0
9095
local_auth: ^2.1.7
9196
flex_color_picker: ^3.3.1
9297
google_fonts: ^6.2.1
9398
chinese_font_library: ^1.1.0
94-
toastification: ^2.0.0
99+
# toastification: ^2.0.0
95100
haptic_feedback: ^0.5.1+1
96101

97102

@@ -100,12 +105,12 @@ dependencies:
100105
ios_utsname_ext: ^2.3.0
101106
ua_client_hints: ^1.4.0
102107
random_user_agents: ^1.0.6
103-
flutter_widget_from_html: ^0.15.3
108+
flutter_widget_from_html: ^0.16.0
104109
html_unescape: ^2.0.0
105110
language_code: ^0.5.5
106111
web: ^1.1.0
107112
persistent_bottom_nav_bar: ^6.2.1
108-
fwfh_cached_network_image: ^0.14.3
113+
fwfh_cached_network_image: ^0.16.0
109114
flutter_cache_manager: ^3.4.1
110115
flutter_cache_manager_dio: ^4.0.0
111116
saver_gallery: ^4.0.1

0 commit comments

Comments
 (0)