Skip to content

Commit e3951e7

Browse files
committed
fix: 🐛 Fixed example app to run in flutter version 3.29.0
1 parent ea99366 commit e3951e7

File tree

5 files changed

+27
-34
lines changed

5 files changed

+27
-34
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- Feature [#500](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/500) -
33
Added `onDismiss` callback in `ShowCaseWidget` which will trigger whenever `onDismiss` method is
44
called
5+
- Fixed example app to run in flutter version `v3.29.0`
56

67
## [4.0.1]
78
- Fixed [#493](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/493) - ShowCase.withWidget not showing issue

example/android/app/build.gradle

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
16
def localProperties = new Properties()
27
def localPropertiesFile = rootProject.file('local.properties')
38
if (localPropertiesFile.exists()) {
@@ -6,11 +11,6 @@ if (localPropertiesFile.exists()) {
611
}
712
}
813

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1414
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1515
if (flutterVersionCode == null) {
1616
flutterVersionCode = '1'
@@ -21,10 +21,6 @@ if (flutterVersionName == null) {
2121
flutterVersionName = '1.0'
2222
}
2323

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2824
android {
2925
compileSdkVersion 34
3026

@@ -58,7 +54,6 @@ flutter {
5854
}
5955

6056
dependencies {
61-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
6257
testImplementation 'junit:junit:4.13.1'
6358
androidTestImplementation 'com.android.support.test:runner:1.0.2'
6459
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

example/android/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
jcenter()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.3.0'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()

example/android/settings.gradle

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
411

5-
def plugins = new Properties()
6-
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7-
if (pluginsFile.exists()) {
8-
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
917
}
1018

11-
plugins.each { name, path ->
12-
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13-
include ":$name"
14-
project(":$name").projectDir = pluginDirectory
19+
plugins {
20+
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.7.10" apply false
1523
}
24+
25+
include ":app"

example/macos/Runner/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Cocoa
22
import FlutterMacOS
33

4-
@NSApplicationMain
4+
@main
55
class AppDelegate: FlutterAppDelegate {
66
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
77
return true

0 commit comments

Comments
 (0)