Skip to content

Commit 120a9de

Browse files
committed
feat: Upgrading dependencies and migrating project to Android embedded v2.
1 parent 2f948e2 commit 120a9de

File tree

17 files changed

+193
-46
lines changed

17 files changed

+193
-46
lines changed

android/app/build.gradle

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,29 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion 28
29+
compileSdkVersion flutter.compileSdkVersion
30+
ndkVersion flutter.ndkVersion
3031

31-
sourceSets {
32-
main.java.srcDirs += 'src/main/kotlin'
32+
compileOptions {
33+
sourceCompatibility JavaVersion.VERSION_1_8
34+
targetCompatibility JavaVersion.VERSION_1_8
35+
}
36+
37+
kotlinOptions {
38+
jvmTarget = '1.8'
3339
}
3440

35-
lintOptions {
36-
disable 'InvalidPackage'
41+
sourceSets {
42+
main.java.srcDirs += 'src/main/kotlin'
3743
}
3844

3945
defaultConfig {
4046
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4147
applicationId "com.dwyl.todolist"
42-
minSdkVersion 16
43-
targetSdkVersion 28
48+
// You can update the following values to match your application needs.
49+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50+
minSdkVersion flutter.minSdkVersion
51+
targetSdkVersion flutter.targetSdkVersion
4452
versionCode flutterVersionCode.toInteger()
4553
versionName flutterVersionName
4654
}

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.dwyl.todolist">
3-
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
4-
calls FlutterMain.startInitialization(this); in its onCreate method.
5-
In most cases you can leave this as-is, but you if you want to provide
6-
additional functionality it is fine to subclass or reimplement
7-
FlutterApplication and put your custom class here. -->
83
<application
9-
android:name="io.flutter.app.FlutterApplication"
4+
android:name="${applicationName}"
105
android:label="todolist"
116
android:icon="@mipmap/ic_launcher">
127
<activity
138
android:name=".MainActivity"
9+
android:exported="true"
1410
android:launchMode="singleTop"
1511
android:theme="@style/LaunchTheme"
1612
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
@@ -24,15 +20,6 @@
2420
android:name="io.flutter.embedding.android.NormalTheme"
2521
android:resource="@style/NormalTheme"
2622
/>
27-
<!-- Displays an Android View that continues showing the launch screen
28-
Drawable until Flutter paints its first frame, then this splash
29-
screen fades out. A splash screen is useful to avoid any visual
30-
gap between the end of Android's launch screen and the painting of
31-
Flutter's first frame. -->
32-
<meta-data
33-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
34-
android:resource="@drawable/launch_background"
35-
/>
3623
<intent-filter>
3724
<action android:name="android.intent.action.MAIN"/>
3825
<category android:name="android.intent.category.LAUNCHER"/>

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
buildscript {
2-
ext.kotlin_version = '1.3.50'
2+
ext.kotlin_version = '1.6.10'
33
repositories {
44
google()
5-
jcenter()
5+
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.5.0'
9+
classpath 'com.android.tools.build:gradle:7.1.2'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
1313

1414
allprojects {
1515
repositories {
1616
google()
17-
jcenter()
17+
mavenCentral()
1818
}
1919
}
2020

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>9.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>

ios/Flutter/Debug.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"

ios/Flutter/Release.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

ios/Podfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '11.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
33+
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35+
end
36+
37+
post_install do |installer|
38+
installer.pods_project.targets.each do |target|
39+
flutter_additional_ios_build_settings(target)
40+
end
41+
end

ios/Podfile.lock

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
PODS:
2+
- Flutter (1.0.0)
3+
- integration_test (0.0.1):
4+
- Flutter
5+
- shared_preferences_ios (0.0.1):
6+
- Flutter
7+
8+
DEPENDENCIES:
9+
- Flutter (from `Flutter`)
10+
- integration_test (from `.symlinks/plugins/integration_test/ios`)
11+
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
12+
13+
EXTERNAL SOURCES:
14+
Flutter:
15+
:path: Flutter
16+
integration_test:
17+
:path: ".symlinks/plugins/integration_test/ios"
18+
shared_preferences_ios:
19+
:path: ".symlinks/plugins/shared_preferences_ios/ios"
20+
21+
SPEC CHECKSUMS:
22+
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
23+
integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5
24+
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
25+
26+
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
27+
28+
COCOAPODS: 1.11.3

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12+
5B0D8897090D24F230FB7390 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 604922C6BEF12990780D5774 /* Pods_Runner.framework */; };
1213
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
1314
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1415
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -31,10 +32,14 @@
3132
/* Begin PBXFileReference section */
3233
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3334
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
35+
170605C8F201584F69EAE5D6 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
3436
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
37+
604922C6BEF12990780D5774 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
38+
70A1FD9E076E261E65973228 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3539
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3640
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3741
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
42+
925C13E5EEF3BA59B92C3E4A /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
3843
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
3944
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
4045
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -49,6 +54,7 @@
4954
isa = PBXFrameworksBuildPhase;
5055
buildActionMask = 2147483647;
5156
files = (
57+
5B0D8897090D24F230FB7390 /* Pods_Runner.framework in Frameworks */,
5258
);
5359
runOnlyForDeploymentPostprocessing = 0;
5460
};
@@ -72,6 +78,8 @@
7278
9740EEB11CF90186004384FC /* Flutter */,
7379
97C146F01CF9000F007C117D /* Runner */,
7480
97C146EF1CF9000F007C117D /* Products */,
81+
BC82DE19A578E523B5B5CF34 /* Pods */,
82+
9BD3C7584771F346E68145C0 /* Frameworks */,
7583
);
7684
sourceTree = "<group>";
7785
};
@@ -98,19 +106,40 @@
98106
path = Runner;
99107
sourceTree = "<group>";
100108
};
109+
9BD3C7584771F346E68145C0 /* Frameworks */ = {
110+
isa = PBXGroup;
111+
children = (
112+
604922C6BEF12990780D5774 /* Pods_Runner.framework */,
113+
);
114+
name = Frameworks;
115+
sourceTree = "<group>";
116+
};
117+
BC82DE19A578E523B5B5CF34 /* Pods */ = {
118+
isa = PBXGroup;
119+
children = (
120+
170605C8F201584F69EAE5D6 /* Pods-Runner.debug.xcconfig */,
121+
925C13E5EEF3BA59B92C3E4A /* Pods-Runner.release.xcconfig */,
122+
70A1FD9E076E261E65973228 /* Pods-Runner.profile.xcconfig */,
123+
);
124+
name = Pods;
125+
path = Pods;
126+
sourceTree = "<group>";
127+
};
101128
/* End PBXGroup section */
102129

103130
/* Begin PBXNativeTarget section */
104131
97C146ED1CF9000F007C117D /* Runner */ = {
105132
isa = PBXNativeTarget;
106133
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107134
buildPhases = (
135+
1C790CC58262B0DEB24B9063 /* [CP] Check Pods Manifest.lock */,
108136
9740EEB61CF901F6004384FC /* Run Script */,
109137
97C146EA1CF9000F007C117D /* Sources */,
110138
97C146EB1CF9000F007C117D /* Frameworks */,
111139
97C146EC1CF9000F007C117D /* Resources */,
112140
9705A1C41CF9048500538489 /* Embed Frameworks */,
113141
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142+
352104188484F5712D09D327 /* [CP] Embed Pods Frameworks */,
114143
);
115144
buildRules = (
116145
);
@@ -127,7 +156,7 @@
127156
97C146E61CF9000F007C117D /* Project object */ = {
128157
isa = PBXProject;
129158
attributes = {
130-
LastUpgradeCheck = 1020;
159+
LastUpgradeCheck = 1300;
131160
ORGANIZATIONNAME = "";
132161
TargetAttributes = {
133162
97C146ED1CF9000F007C117D = {
@@ -169,6 +198,45 @@
169198
/* End PBXResourcesBuildPhase section */
170199

171200
/* Begin PBXShellScriptBuildPhase section */
201+
1C790CC58262B0DEB24B9063 /* [CP] Check Pods Manifest.lock */ = {
202+
isa = PBXShellScriptBuildPhase;
203+
buildActionMask = 2147483647;
204+
files = (
205+
);
206+
inputFileListPaths = (
207+
);
208+
inputPaths = (
209+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
210+
"${PODS_ROOT}/Manifest.lock",
211+
);
212+
name = "[CP] Check Pods Manifest.lock";
213+
outputFileListPaths = (
214+
);
215+
outputPaths = (
216+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
217+
);
218+
runOnlyForDeploymentPostprocessing = 0;
219+
shellPath = /bin/sh;
220+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
221+
showEnvVarsInLog = 0;
222+
};
223+
352104188484F5712D09D327 /* [CP] Embed Pods Frameworks */ = {
224+
isa = PBXShellScriptBuildPhase;
225+
buildActionMask = 2147483647;
226+
files = (
227+
);
228+
inputFileListPaths = (
229+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
230+
);
231+
name = "[CP] Embed Pods Frameworks";
232+
outputFileListPaths = (
233+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
234+
);
235+
runOnlyForDeploymentPostprocessing = 0;
236+
shellPath = /bin/sh;
237+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
238+
showEnvVarsInLog = 0;
239+
};
172240
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173241
isa = PBXShellScriptBuildPhase;
174242
buildActionMask = 2147483647;
@@ -272,7 +340,7 @@
272340
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273341
GCC_WARN_UNUSED_FUNCTION = YES;
274342
GCC_WARN_UNUSED_VARIABLE = YES;
275-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
343+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
276344
MTL_ENABLE_DEBUG_INFO = NO;
277345
SDKROOT = iphoneos;
278346
SUPPORTED_PLATFORMS = iphoneos;
@@ -294,7 +362,10 @@
294362
"$(PROJECT_DIR)/Flutter",
295363
);
296364
INFOPLIST_FILE = Runner/Info.plist;
297-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
365+
LD_RUNPATH_SEARCH_PATHS = (
366+
"$(inherited)",
367+
"@executable_path/Frameworks",
368+
);
298369
LIBRARY_SEARCH_PATHS = (
299370
"$(inherited)",
300371
"$(PROJECT_DIR)/Flutter",
@@ -354,7 +425,7 @@
354425
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
355426
GCC_WARN_UNUSED_FUNCTION = YES;
356427
GCC_WARN_UNUSED_VARIABLE = YES;
357-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
428+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
358429
MTL_ENABLE_DEBUG_INFO = YES;
359430
ONLY_ACTIVE_ARCH = YES;
360431
SDKROOT = iphoneos;
@@ -403,7 +474,7 @@
403474
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
404475
GCC_WARN_UNUSED_FUNCTION = YES;
405476
GCC_WARN_UNUSED_VARIABLE = YES;
406-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
477+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
407478
MTL_ENABLE_DEBUG_INFO = NO;
408479
SDKROOT = iphoneos;
409480
SUPPORTED_PLATFORMS = iphoneos;
@@ -426,7 +497,10 @@
426497
"$(PROJECT_DIR)/Flutter",
427498
);
428499
INFOPLIST_FILE = Runner/Info.plist;
429-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
500+
LD_RUNPATH_SEARCH_PATHS = (
501+
"$(inherited)",
502+
"@executable_path/Frameworks",
503+
);
430504
LIBRARY_SEARCH_PATHS = (
431505
"$(inherited)",
432506
"$(PROJECT_DIR)/Flutter",
@@ -453,7 +527,10 @@
453527
"$(PROJECT_DIR)/Flutter",
454528
);
455529
INFOPLIST_FILE = Runner/Info.plist;
456-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
530+
LD_RUNPATH_SEARCH_PATHS = (
531+
"$(inherited)",
532+
"@executable_path/Frameworks",
533+
);
457534
LIBRARY_SEARCH_PATHS = (
458535
"$(inherited)",
459536
"$(PROJECT_DIR)/Flutter",

0 commit comments

Comments
 (0)