Skip to content

Commit

Permalink
Upgrade flutter, inappwebview, AGP and Android Compile SDK (#280)
Browse files Browse the repository at this point in the history
* Upgrade flutter, inappwebview, AGP and Android Compile SDK

* Fix dart warnings

* Add android resource linking failed workaround and update deps

* Remove library names

* Revert project.pbxproj changes

* chore: update dependencies to latest resolvable

- Update AGP to 8.2.1
- Bump Flutter SDK lower bound to 3.24.0

* chore: update source and target compatibility

warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release

* Apply resource linking workaround only on affected plugins

- Log affected plugins
- Group everything under single subprojects block

* Remove package name from AndroidManifest

* Replace the discontinued uni_links plugin with app_links

Remove app_group_directory  & uni_links from main pubspec file as they are not referenced on the app.

* Use latest flutter_fgbg from pub.dev

Multiple listeners are now allowed on events stream.

* chore: install & update pods

* Add warning for Flutter plugins with missing namespaces

- Apply changes to resource linking work around as well.

---------

Co-authored-by: Erdem Yerebasmaz <[email protected]>
  • Loading branch information
danielgranhao and erdemyerebasmaz authored Jan 6, 2025
1 parent 89979bf commit fb86737
Show file tree
Hide file tree
Showing 88 changed files with 1,529 additions and 1,168 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: 3.22.3 # Pinned until resource linking issues on Android is resolved with 3.24
flutter-version: 3.27.1
cache: true

- name: 📦 Install Flutter dependencies
Expand All @@ -66,4 +66,4 @@ jobs:

- name: Check Formatting
working-directory: lbreez
run: dart format -o none --set-exit-if-changed -l 110 .
run: dart format -o none --set-exit-if-changed -l 110 .
4 changes: 2 additions & 2 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: 3.22.3 # Pinned until resource linking issues on Android is resolved with 3.24
flutter-version: 3.27.1
cache: true

- name: Set up just
Expand Down Expand Up @@ -301,4 +301,4 @@ jobs:
run: |
if [ -d "lbreez" ] && [ -f "lbreez/google-application-credentials.json" ]; then
rm lbreez/google-application-credentials.json
fi
fi
4 changes: 2 additions & 2 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: 3.22.3 # Pinned until resource linking issues on Android is resolved with 3.24
flutter-version: 3.27.1
cache: true

- name: Set up just
Expand Down Expand Up @@ -400,4 +400,4 @@ jobs:
run: |
if [ -d "lbreez" ] && [ -f "lbreez/google-application-credentials.json" ]; then
rm lbreez/google-application-credentials.json
fi
fi
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down Expand Up @@ -57,4 +59,4 @@ config.json
.flutter-version

# Swift Package Manager
Package.resolved
Package.resolved
10 changes: 5 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ def envVariables = [

android {
namespace = "com.breez.liquid.l_breez"
compileSdkVersion 34
compileSdkVersion 35
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = "17"
}

sourceSets {
Expand Down Expand Up @@ -156,4 +156,4 @@ dependencies {
/* Logging */
implementation 'org.tinylog:tinylog-api-kotlin:2.6.2'
implementation 'org.tinylog:tinylog-impl:2.6.2'
}
}
3 changes: 1 addition & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
paxkage="com.breez.liquid.l_breez">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC" /> <!-- Android 9+ -->
<uses-permission android:name="android.permission.NFC"/> <!-- Deep links -->
Expand Down
34 changes: 32 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,39 @@ allprojects {

rootProject.buildDir = "../build"
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
project.logger.error(
"Warning: 'namespace' property for Flutter plugin '${project.name}' is not defined."
+ " Setting the 'namespace' property to '${project.group}' as a fallback."
+ "\nWith AGP 8.+, the 'namespace' property must be explicitly defined in the module-level build script."
+ "\nIf a new version of '${project.name}' is not available, consider filing an issue against '${project.name}'"
+ " to add 'namespace' property on their module-level build script (otherwise try updating to the latest version)."
)
namespace project.group
}
}
}

Integer pluginCompileSdk = project.android.compileSdk
if ((project.plugins.hasPlugin("com.android.application") || project.plugins.hasPlugin("com.android.library")) && pluginCompileSdk != null && pluginCompileSdk < 31) {
project.logger.error(
"Warning: Overriding 'compileSdkVersion' version on Flutter plugin '${project.name}' from "
+ pluginCompileSdk
+ " to 35 (to work around https://issuetracker.google.com/issues/199180389)."
+ "\nIf a new version of '${project.name}' is not available, consider filing an issue against '${project.name}'"
+ " to increase their compileSdkVersion to the latest (otherwise try updating to the latest version)."
)
project.android {
compileSdkVersion 35
buildToolsVersion "35.0.0"
}
}
}

project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
}

Expand Down
4 changes: 3 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '7.4.2' apply false
id "com.android.application" version '8.2.1' apply false
id "org.jetbrains.kotlin.android" version "1.9.22" apply false
// TODO: Build Step
id "org.jetbrains.kotlin.plugin.serialization" version "1.9.22" apply false
Expand Down
38 changes: 19 additions & 19 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
PODS:
- app_group_directory (1.0.0):
- Flutter
- app_links (0.0.2):
- Flutter
- clipboard_watcher (0.0.1):
- Flutter
- connectivity_plus (0.0.1):
Expand All @@ -16,7 +18,7 @@ PODS:
- Firebase/Messaging (11.4.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 11.4.0)
- firebase_core (3.8.1):
- firebase_core (3.9.0):
- Firebase/CoreOnly (= 11.4.0)
- Flutter
- firebase_dynamic_links (6.0.11):
Expand Down Expand Up @@ -57,10 +59,10 @@ PODS:
- flutter_inappwebview_ios (0.0.1):
- Flutter
- flutter_inappwebview_ios/Core (= 0.0.1)
- OrderedSet (~> 5.0)
- OrderedSet (~> 6.0.3)
- flutter_inappwebview_ios/Core (0.0.1):
- Flutter
- OrderedSet (~> 5.0)
- OrderedSet (~> 6.0.3)
- flutter_keyboard_visibility (0.0.1):
- Flutter
- flutter_secure_storage (6.0.0):
Expand Down Expand Up @@ -140,7 +142,7 @@ PODS:
- ObjcExceptionBridging (7.1.5):
- ObjcExceptionBridging/ObjcExceptionBridging (= 7.1.5)
- ObjcExceptionBridging/ObjcExceptionBridging (7.1.5)
- OrderedSet (5.0.0)
- OrderedSet (6.0.3)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
Expand All @@ -154,12 +156,10 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.3):
- sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
- TOCropViewController (2.7.4)
- uni_links (0.0.1):
- Flutter
- url_launcher_ios (0.0.1):
- Flutter
- XCGLogger (7.1.5):
Expand All @@ -169,6 +169,7 @@ PODS:

DEPENDENCIES:
- app_group_directory (from `.symlinks/plugins/app_group_directory/ios`)
- app_links (from `.symlinks/plugins/app_links/ios`)
- clipboard_watcher (from `.symlinks/plugins/clipboard_watcher/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
Expand All @@ -191,8 +192,7 @@ DEPENDENCIES:
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preference_app_group (from `.symlinks/plugins/shared_preference_app_group/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- uni_links (from `.symlinks/plugins/uni_links/ios`)
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- XCGLogger

Expand Down Expand Up @@ -224,6 +224,8 @@ SPEC REPOS:
EXTERNAL SOURCES:
app_group_directory:
:path: ".symlinks/plugins/app_group_directory/ios"
app_links:
:path: ".symlinks/plugins/app_links/ios"
clipboard_watcher:
:path: ".symlinks/plugins/clipboard_watcher/ios"
connectivity_plus:
Expand Down Expand Up @@ -266,20 +268,19 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/shared_preference_app_group/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/darwin"
uni_links:
:path: ".symlinks/plugins/uni_links/ios"
sqflite_darwin:
:path: ".symlinks/plugins/sqflite_darwin/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
app_group_directory: 7bf9f8f9819ead554de29da7c25fb7a680d6a9a0
app_links: e7a6750a915a9e161c58d91bc610e8cd1d4d0ad0
clipboard_watcher: 86fb70421aca6f4944e0591a8292605da7784666
connectivity_plus: 4c41c08fc6d7c91f63bc7aec70ffe3730b04f563
connectivity_plus: 18382e7311ba19efcaee94442b23b32507b20695
device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
Firebase: cf1b19f21410b029b6786a54e9764a0cacad3c99
firebase_core: 418aed674e9a0b8b6088aec16cde82a811f6261f
firebase_core: b62a5080210edad3f2934314a8b2c6f5124e8e10
firebase_dynamic_links: b6c2a7d6e50d2d0c0ae2acb213af78e9a3d9ce9b
firebase_messaging: 98619a0572d82cfb3668e78859ba9f1110e268c9
FirebaseCore: e0510f1523bc0eb21653cac00792e1e2bd6f1771
Expand All @@ -290,7 +291,7 @@ SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_breez_liquid: 8306e7e1867337fbecadf2b0f538270dc282ea94
flutter_fgbg: 31c0d1140a131daea2d342121808f6aa0dcd879d
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
Expand All @@ -309,16 +310,15 @@ SPEC CHECKSUMS:
mobile_scanner: fd0054c52ede661e80bf5a4dea477a2467356bee
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
ObjcExceptionBridging: d3d37d62981bb7f252ecb31b62d7e23a96bbfb8a
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
shared_preference_app_group: 46aee3873e1da581d4904bece9876596d7f66725
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
XCGLogger: 399c5885210b4e2ad79d9f7a29b105d672ef724f

Expand Down
Loading

0 comments on commit fb86737

Please sign in to comment.