Skip to content

Commit

Permalink
fix android issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kidozh committed Feb 21, 2025
1 parent ade7a09 commit 8003b0c
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 57 deletions.
8 changes: 4 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ android {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility = 17
targetCompatibility = 17
sourceCompatibility = 1.8
targetCompatibility = 1.8
kotlinOptions {
jvmTarget = "17"
jvmTarget = "1.8"
}

}
Expand All @@ -86,7 +86,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.kidozh.discuz_flutter"
minSdkVersion 26
minSdkVersion 30
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
53 changes: 33 additions & 20 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ buildscript {
google()
mavenCentral()
}
ext.kotlin_version = '2.1.0'
ext.kotlin_version = '1.9.22'
// ext {
// agp_version = '7.4.2'
// }
dependencies {
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.15'
// END: FlutterFire Configuration
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.7.3'
}
}

allprojects {
ext.kotlin_version = '1.8.10'
// ext.kotlin_version = '1.8.10'
repositories {
google()
mavenCentral()
Expand All @@ -40,7 +40,7 @@ rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"

afterEvaluate {
afterEvaluate { project ->
// check if android block is available

if (it.hasProperty('android')) {
Expand All @@ -52,25 +52,38 @@ subprojects {
android.namespace = packageName
}

// def javaVersion = JavaVersion.VERSION_17
// android {
// def androidApiVersion = 34
// compileSdkVersion androidApiVersion
// defaultConfig {
// targetSdkVersion androidApiVersion
// if (project.plugins.hasPlugin("com.android.application") ||
// project.plugins.hasPlugin("com.android.library")) {
// project.android {
// compileSdkVersion 34
// buildToolsVersion "34.0.0"
//
// }
// compileOptions {
// sourceCompatibility javaVersion
// targetCompatibility javaVersion
// project.android.defaultConfig{
// minSdkVersion 30
// //targetSdkVersion 34
// }
// tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
// kotlinOptions {
// jvmTarget = javaVersion.toString()
// }
// }
// println("Setting java version to ${javaVersion.toString()} which is $javaVersion")
// println("Setting compileSdkVersion and targetSdkVersion to $androidApiVersion")
// }

def javaVersion = JavaVersion.VERSION_18
android {
def androidApiVersion = 34
compileSdkVersion androidApiVersion
defaultConfig {
targetSdkVersion androidApiVersion
}
compileOptions {
sourceCompatibility javaVersion
targetCompatibility javaVersion
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = javaVersion.toString()
}
}
println("Setting java version to ${javaVersion.toString()} which is $javaVersion")
println("Setting compileSdkVersion and targetSdkVersion to $androidApiVersion")
}
}

}
Expand Down
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
kotlin.jvm.target.validation.mode = IGNORE
android.jetifier.ignorelist=bcprov-jdk18on-1.78.1.jar
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
53 changes: 26 additions & 27 deletions lib/utility/ToastUtils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import 'package:discuz_flutter/utility/AppPlatformIcons.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:toastification/toastification.dart';

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

}

static void showInfoToast(BuildContext context, String msg) {
// EasyLoading.showSuccess(
// msg,
// );

toastification.show(context: context,
title: Text(msg),
style: ToastificationStyle.fillColored,
autoCloseDuration: const Duration(seconds: 2),
showProgressBar: false,
type: ToastificationType.info,
icon: Icon(AppPlatformIcons(context).check),
alignment: Alignment.topCenter


);
}

static void showErrorToast(BuildContext context, String msg) {
toastification.show(context: context,
title: Text(msg),
style: ToastificationStyle.fillColored,
autoCloseDuration: const Duration(milliseconds: 500),
type: ToastificationType.error
);
}
// static void showInfoToast(BuildContext context, String msg) {
// // EasyLoading.showSuccess(
// // msg,
// // );
//
// toastification.show(context: context,
// title: Text(msg),
// style: ToastificationStyle.fillColored,
// autoCloseDuration: const Duration(seconds: 2),
// showProgressBar: false,
// type: ToastificationType.info,
// icon: Icon(AppPlatformIcons(context).check),
// alignment: Alignment.topCenter
//
//
// );
// }

// static void showErrorToast(BuildContext context, String msg) {
// toastification.show(context: context,
// title: Text(msg),
// style: ToastificationStyle.fillColored,
// autoCloseDuration: const Duration(milliseconds: 500),
// type: ToastificationType.error
// );
// }
}
15 changes: 10 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ dependencies:
permission_handler: ^11.0.0
# open_file: ^3.2.1
flutter_slidable:
webview_cookie_manager: ^2.0.6
webview_cookie_manager:
git:
url: https://github.com/fryette/webview_cookie_manager
ref: 8572dd54c437c919aedc8dca6c5bffd25fe74b3
intl: ^0.19.0
flutter_platform_widgets: ^7.0.0
flutter_launcher_icons: ^0.14.1
Expand Down Expand Up @@ -83,15 +86,17 @@ dependencies:
google_mobile_ads: ^5.1.0
dynamic_color: ^1.6.7
intl_utils: ^2.8.1
dual_screen: ^1.0.3
dual_screen:
git:
url: https://github.com/mwdavis84/flutter-dualscreen
carousel_slider: ^5.0.0
upgrader: ^11.3.0
flutter_secure_storage: ^9.0.0
local_auth: ^2.1.7
flex_color_picker: ^3.3.1
google_fonts: ^6.2.1
chinese_font_library: ^1.1.0
toastification: ^2.0.0
# toastification: ^2.0.0
haptic_feedback: ^0.5.1+1


Expand All @@ -100,12 +105,12 @@ dependencies:
ios_utsname_ext: ^2.3.0
ua_client_hints: ^1.4.0
random_user_agents: ^1.0.6
flutter_widget_from_html: ^0.15.3
flutter_widget_from_html: ^0.16.0
html_unescape: ^2.0.0
language_code: ^0.5.5
web: ^1.1.0
persistent_bottom_nav_bar: ^6.2.1
fwfh_cached_network_image: ^0.14.3
fwfh_cached_network_image: ^0.16.0
flutter_cache_manager: ^3.4.1
flutter_cache_manager_dio: ^4.0.0
saver_gallery: ^4.0.1
Expand Down

0 comments on commit 8003b0c

Please sign in to comment.