Skip to content

Commit 32f3447

Browse files
Merge pull request #82 from icapps/feature/update-gradle-and-kotlin
Updated gradle versions
2 parents 1d580c3 + c37c62d commit 32f3447

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+706
-340
lines changed

.fvmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"flutter": "3.27.3"
3+
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,6 @@ test/coverage_helper_test.dart
9191
**_testImage.png
9292

9393
# Fvm
94-
.fvm/flutter_sdk
94+
95+
# FVM Version Cache
96+
.fvm/

.vscode/launch.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "flutter-background-location-tracker",
9+
"request": "launch",
10+
"type": "dart"
11+
},
12+
{
13+
"name": "example",
14+
"cwd": "example",
15+
"request": "launch",
16+
"type": "dart"
17+
},
18+
{
19+
"name": "example (release mode)",
20+
"cwd": "example",
21+
"request": "launch",
22+
"type": "dart",
23+
"flutterMode": "release"
24+
}
25+
]
26+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dart.flutterSdkPath": ".fvm/versions/3.27.3"
3+
}

CHANGELOG.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
## 1.4.3 - 28-03-2024
1+
## 1.5.0 - 2025-01-27
2+
- Updated gradle dependencies
3+
4+
## 1.4.3 - 2024-03-28
25
- Updated targetSdkVersion to 34 and added FOREGROUND_SERVICE_LOCATION for support Android 14
36
- Removed unrecognized_error_code from analysis_options.yaml
47

5-
## 1.4.2 - 11-09-2023
8+
## 1.4.2 - 2023-09-11
69
- Added fromJson/toJson/toString/equals/copyWith methods in BackgroundLocationUpdateData
710

8-
## 1.4.1 - 17-06-2023
11+
## 1.4.1 - 2023-06-17
912
- Updates Play Services Location library
1013

11-
## 1.4.0 - 11-01-2023
14+
## 1.4.0 - 2023-01-11
1215
- Added extra fields. (-1 if not supported or not available)
1316
- horizontalAccuracy
1417
- alt
@@ -18,35 +21,35 @@
1821
- speed
1922
- speedAccuracy (Android > O)
2023

21-
## 1.3.1 - 14-12-2022
24+
## 1.3.1 - 2022-12-14
2225
- Fix crash with starting service in background
2326

24-
## 1.3.0 - 12-09-2022
27+
## 1.3.0 - 2022-09-12
2528
- Added support for android sdk 33
2629
- Updated dependencies
2730
- Updated kotlin
2831
- Fixed the breaking changes on the native android side
2932
- Updated the example project to save the background locations to shared prefs
3033
- Updated the example project & readme to use the `@pragma('vm:entry-point')` annotation
3134

32-
## 1.2.0 - 15-11-2021
35+
## 1.2.0 - 2021-11-15
3336
- Added iOS specific options to restart the tracking after killing the app
3437
- Added option to Android specific options to only get updates every x meters
3538

36-
## 1.1.0 - 14-10-2021
39+
## 1.1.0 - 2021-10-14
3740
#Added
3841
- Added more options to android config to specify update interval
3942
- Added iOS specific options to control activity type and/or distance filter
4043

41-
## 1.0.2 - 22-06-2021
44+
## 1.0.2 - 2021-06-22
4245
#Fixed
4346
- Formatting
4447

45-
## 1.0.1 - 22-06-2021
48+
## 1.0.1 - 2021-06-22
4649
#Added
4750
- Pub.dev badge
4851

49-
## 1.0.0 - 22-06-2021
52+
## 1.0.0 - 2021-06-22
5053
Initial release
5154
- Background location tracking
5255
- Nullsafety

analysis_options.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ linter:
5656
- file_names
5757
- hash_and_equals
5858
- implementation_imports
59-
- invariant_booleans
6059
- collection_methods_unrelated_type
6160
- join_return_with_assignment
6261
- library_names
@@ -83,7 +82,6 @@ linter:
8382
- prefer_const_literals_to_create_immutables
8483
- prefer_constructors_over_static_methods
8584
- prefer_contains
86-
- prefer_equal_for_default_values
8785
- prefer_final_fields
8886
- prefer_final_in_for_each
8987
- prefer_final_locals

android/build.gradle

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:7.3.1'
12+
classpath 'com.android.tools.build:gradle:8.3.2'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
1515
}
@@ -27,11 +27,22 @@ apply plugin: 'kotlin-android'
2727
android {
2828
compileSdkVersion 34
2929

30+
namespace 'com.icapps.background_location_tracker'
31+
32+
compileOptions {
33+
sourceCompatibility = JavaVersion.VERSION_17
34+
targetCompatibility = JavaVersion.VERSION_17
35+
}
36+
37+
kotlinOptions {
38+
jvmTarget = JavaVersion.VERSION_17
39+
}
40+
3041
sourceSets {
3142
main.java.srcDirs += 'src/main/kotlin'
3243
}
3344
defaultConfig {
34-
minSdkVersion 16
45+
minSdkVersion 19
3546
targetSdkVersion 34
3647
}
3748
lintOptions {

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
36
zipStoreBase=GRADLE_USER_HOME
47
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
66
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
77
<uses-permission android:name="android.permission.WAKE_LOCK" />
8+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
89
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
910

1011
<application>

android/src/main/kotlin/com/icapps/background_location_tracker/utils/NotificationUtil.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ internal object NotificationUtil {
5959
val clickPendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
6060
PendingIntent.getActivity(context, 0, context.packageManager.getLaunchIntentForPackage(context.packageName), PendingIntent.FLAG_IMMUTABLE)
6161
} else {
62+
@Suppress("UnspecifiedImmutableFlag")
6263
PendingIntent.getActivity(context, 0, context.packageManager.getLaunchIntentForPackage(context.packageName), 0)
6364
}
6465

example/.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
13+
migrate_working_dir/
1114

1215
# IntelliJ related
1316
*.iml
@@ -26,16 +29,17 @@
2629
.dart_tool/
2730
.flutter-plugins
2831
.flutter-plugins-dependencies
29-
.packages
3032
.pub-cache/
3133
.pub/
3234
/build/
3335

34-
# Web related
35-
lib/generated_plugin_registrant.dart
36-
3736
# Symbolication related
3837
app.*.symbols
3938

4039
# Obfuscation related
4140
app.*.map.json
41+
42+
# Android Studio will place build artifacts here
43+
/android/app/debug
44+
/android/app/profile
45+
/android/app/release

example/.metadata

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,42 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818
8-
channel: stable
7+
revision: "17025dd88227cd9532c33fa78f5250d548d87e9a"
8+
channel: "stable"
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
17+
base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
18+
- platform: android
19+
create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
20+
base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
21+
- platform: ios
22+
create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
23+
base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
24+
- platform: linux
25+
create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
26+
base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
27+
- platform: macos
28+
create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
29+
base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
30+
- platform: web
31+
create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
32+
base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
33+
- platform: windows
34+
create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
35+
base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# background_location_tracker_example
1+
# example
22

3-
Demonstrates how to use the background_location_tracker plugin.
3+
A new Flutter project.
44

55
## Getting Started
66

77
This project is a starting point for a Flutter application.
88

99
A few resources to get you started if this is your first Flutter project:
1010

11-
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
11+
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
1313

14-
For help getting started with Flutter, view our
15-
[online documentation](https://flutter.dev/docs), which offers tutorials,
14+
For help getting started with Flutter development, view the
15+
[online documentation](https://docs.flutter.dev/), which offers tutorials,
1616
samples, guidance on mobile development, and a full API reference.

example/analysis_options.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
linter:
4+
rules:

example/android/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ gradle-wrapper.jar
77
GeneratedPluginRegistrant.java
88

99
# Remember to never publicly share your keystore.
10-
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
10+
# See https://flutter.dev/to/reference-keystore
1111
key.properties
12+
**/*.keystore
13+
**/*.jks

example/android/app/build.gradle

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,47 @@
1-
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
3-
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
5-
localProperties.load(reader)
6-
}
7-
}
8-
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-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
176
}
187

19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
22-
}
23-
24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
288
android {
29-
compileSdkVersion 34
9+
namespace = "com.example.example"
10+
compileSdk = 34
11+
ndkVersion = flutter.ndkVersion
3012

31-
sourceSets {
32-
main.java.srcDirs += 'src/main/kotlin'
13+
compileOptions {
14+
sourceCompatibility = JavaVersion.VERSION_17
15+
targetCompatibility = JavaVersion.VERSION_17
3316
}
3417

35-
lintOptions {
36-
disable 'InvalidPackage'
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_17
3720
}
3821

3922
defaultConfig {
4023
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41-
applicationId "com.icapps.background_location_tracker_example"
24+
applicationId = "com.example.example"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
4227
minSdkVersion flutter.minSdkVersion
28+
multiDexEnabled true
4329
targetSdkVersion 34
44-
versionCode flutterVersionCode.toInteger()
45-
versionName flutterVersionName
30+
minSdk = 19
31+
targetSdk = 34
32+
versionCode = flutter.versionCode
33+
versionName = flutter.versionName
4634
}
4735

4836
buildTypes {
4937
release {
5038
// TODO: Add your own signing config for the release build.
5139
// Signing with the debug keys for now, so `flutter run --release` works.
52-
signingConfig signingConfigs.debug
40+
signingConfig = signingConfigs.debug
5341
}
5442
}
5543
}
5644

5745
flutter {
58-
source '../..'
59-
}
60-
61-
dependencies {
62-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
46+
source = "../.."
6347
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>

0 commit comments

Comments
 (0)