Skip to content

Commit 9731fd9

Browse files
authored
AGP8 compatibility (Nimrodda#48)
* added namespace for AGP8 compatibility * updated gitignore * upgrades to compile/run example * Update build.gradle * fvm: updated flutter version to latest stable * addressed static analysis issues
1 parent 0e46bc9 commit 9731fd9

File tree

12 files changed

+142
-75
lines changed

12 files changed

+142
-75
lines changed

.fvm/fvm_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"flutterSdkVersion": "3.0.3",
2+
"flutterSdkVersion": "3.13.9",
33
"flavors": {}
44
}

.gitignore

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,44 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
16
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
227
.dart_tool/
3-
.fvm/flutter_sdk
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
430
.packages
31+
.pub-cache/
532
.pub/
6-
/pubspec.lock
7-
build/
33+
/build/
34+
35+
# Symbolication related
36+
app.*.symbols
37+
38+
# Obfuscation related
39+
app.*.map.json
40+
41+
# Android Studio will place build artifacts here
42+
/android/app/debug
43+
/android/app/profile
44+
/android/app/release

android/.gitignore

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
*.iml
2-
.gradle
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
36
/local.properties
4-
/.idea/workspace.xml
5-
/.idea/libraries
6-
.DS_Store
7-
/build
8-
/captures
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks

android/build.gradle

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,35 @@ group 'com.nimroddayan.flutternsd'
1919
version '1.0-SNAPSHOT'
2020

2121
buildscript {
22-
ext.kotlin_version = '1.5.20'
22+
ext.kotlin_version = '1.7.10'
2323
repositories {
2424
google()
25-
jcenter()
25+
mavenCentral()
2626
}
2727

2828
dependencies {
29-
classpath 'com.android.tools.build:gradle:4.0.1'
29+
classpath 'com.android.tools.build:gradle:7.3.1'
3030
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
3131
}
3232
}
3333

3434
rootProject.allprojects {
3535
repositories {
3636
google()
37-
jcenter()
37+
mavenCentral()
3838
}
3939
}
4040

4141
apply plugin: 'com.android.library'
4242
apply plugin: 'kotlin-android'
4343

4444
android {
45-
compileSdkVersion 29
45+
// Conditional for compatibility with AGP <4.2.
46+
if (project.android.hasProperty("namespace")) {
47+
namespace 'com.nimroddayan.flutternsd'
48+
}
49+
50+
compileSdkVersion 33
4651

4752
sourceSets {
4853
main.java.srcDirs += 'src/main/kotlin'

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ distributionBase=GRADLE_USER_HOME
1919
distributionPath=wrapper/dists
2020
zipStoreBase=GRADLE_USER_HOME
2121
zipStorePath=wrapper/dists
22-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
22+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ apply plugin: 'kotlin-android'
4343
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
4444

4545
android {
46-
compileSdkVersion 29
46+
compileSdkVersion 33
4747

4848
sourceSets {
4949
main.java.srcDirs += 'src/main/kotlin'

example/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@
1616
*/
1717

1818
buildscript {
19-
ext.kotlin_version = '1.4.0'
19+
ext.kotlin_version = '1.7.10'
2020
repositories {
2121
google()
22-
jcenter()
22+
mavenCentral()
2323
}
2424

2525
dependencies {
26-
classpath 'com.android.tools.build:gradle:4.0.1'
26+
classpath 'com.android.tools.build:gradle:7.3.1'
2727
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2828
}
2929
}
3030

3131
allprojects {
3232
repositories {
3333
google()
34-
jcenter()
34+
mavenCentral()
3535
}
3636
}
3737

@@ -43,6 +43,6 @@ subprojects {
4343
project.evaluationDependsOn(':app')
4444
}
4545

46-
task clean(type: Delete) {
46+
tasks.register("clean", Delete) {
4747
delete rootProject.buildDir
4848
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ distributionBase=GRADLE_USER_HOME
2020
distributionPath=wrapper/dists
2121
zipStoreBase=GRADLE_USER_HOME
2222
zipStorePath=wrapper/dists
23-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
23+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip

0 commit comments

Comments
 (0)