Skip to content

Commit d8e2c0d

Browse files
Sahil Totalavatsaltanna-simformsolutions
authored andcommitted
fix: 🐛gradle issues
1 parent ec6369d commit d8e2c0d

File tree

8 files changed

+91
-49
lines changed

8 files changed

+91
-49
lines changed

.github/pull_request_template.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Description
2+
<!--
3+
Provide a description of what this PR is doing.
4+
If you're modifying existing behavior, describe the existing behavior, how this PR is changing it,
5+
and what motivated the change. If this is a breaking change, specify explicitly which APIs were
6+
changed.
7+
-->
8+
9+
10+
## Checklist
11+
<!--
12+
Before you create this PR confirm that it meets all requirements listed below by checking the
13+
relevant checkboxes with `[x]`. If some checkbox is not applicable, mark it as `[ ]`.
14+
-->
15+
16+
- [ ] The title of my PR starts with a [Conventional Commit] prefix (`fix:`, `feat:`, `docs:` etc).
17+
- [ ] I have followed the [Contributor Guide] when preparing my PR.
18+
- [ ] I have updated/added tests for ALL new/updated/fixed functionality.
19+
- [ ] I have updated/added relevant documentation in `docs` and added dartdoc comments with `///`.
20+
- [ ] I have updated/added relevant examples in `examples` or `docs`.
21+
22+
23+
## Breaking Change?
24+
<!--
25+
Would your PR require ShowCaseView users to update their apps following your change?
26+
27+
If yes, then the title of the PR should include "!" (for example, `feat!:`, `fix!:`). See
28+
[Conventional Commit] for details. Also, for a breaking PR uncomment and fill in the "Migration
29+
instructions" section below.
30+
31+
### Migration instructions
32+
33+
If the PR is breaking, uncomment this header and add instructions for how to migrate from the
34+
currently released version to the new proposed way.
35+
-->
36+
37+
- [ ] Yes, this PR is a breaking change.
38+
- [ ] No, this PR is not a breaking change.
39+
40+
41+
## Related Issues
42+
<!--
43+
Indicate which issues this PR resolves, if any. For example:
44+
Closes #1234
45+
!-->
46+
47+
<!-- Links -->
48+
[Contributor Guide]: https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/blob/master/CONTRIBUTING.md
49+
[Conventional Commit]: https://conventionalcommits.org

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Fixed floating event stream bad state exception [#157](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/issues/157).
44
- Fixed Gyroscope initialization issue [#173](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/issues/173).
55
- Fixed Namespace Not Found issue [#176](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/issues/176).
6+
- Fixed Gradle issues [#181](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/pull/181).
67

78
# [4.0.1](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/tree/4.0.1)
89

android/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
group 'com.simform.flutter_credit_card'
22
version '1.0-SNAPSHOT'
33

4-
buildscript {
5-
ext.kotlin_version = '1.7.10'
6-
repositories {
7-
google()
8-
mavenCentral()
9-
}
10-
11-
dependencies {
12-
classpath 'com.android.tools.build:gradle:7.3.1'
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14-
}
15-
}
16-
174
allprojects {
185
repositories {
196
google()

android/settings.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
plugins {
2+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
3+
id "com.android.application" version "7.3.1" apply false
4+
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
5+
}
6+
17
rootProject.name = 'flutter_credit_card'

example/android/app/build.gradle

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

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-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,12 +22,14 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
android {
29-
compileSdkVersion 31
26+
27+
// Conditional for compatibility with AGP <4.2.
28+
if (project.android.hasProperty("namespace")) {
29+
namespace 'com.simform.example'
30+
}
31+
32+
compileSdk 35
3033

3134
sourceSets {
3235
main.java.srcDirs += 'src/main/kotlin'
@@ -39,7 +42,7 @@ android {
3942
defaultConfig {
4043
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4144
applicationId "com.simform.example"
42-
minSdkVersion 16
45+
minSdkVersion flutter.minSdkVersion
4346
targetSdkVersion 31
4447
versionCode flutterVersionCode.toInteger()
4548
versionName flutterVersionName
@@ -60,7 +63,6 @@ flutter {
6063
}
6164

6265
dependencies {
63-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
6466
testImplementation 'junit:junit:4.12'
6567
androidTestImplementation 'com.android.support.test:runner:1.0.2'
6668
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.2.2'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip

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 "8.1.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.20" apply false
1523
}
24+
25+
include ":app"

0 commit comments

Comments
 (0)