Skip to content

Commit 4cc4239

Browse files
committed
Fixed build issues on ios and android
1 parent 148d49c commit 4cc4239

File tree

11 files changed

+101
-62
lines changed

11 files changed

+101
-62
lines changed

example/android/app/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ android {
3737
}
3838

3939
defaultConfig {
40-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41-
applicationId "com.example.flutter_platform_maps_example"
40+
applicationId "de.luisthein.flutter_platform_maps_example"
4241
minSdkVersion 16
4342
targetSdkVersion 28
4443
versionCode flutterVersionCode.toInteger()
4544
versionName flutterVersionName
46-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
45+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4746
}
4847

4948
buildTypes {
@@ -62,6 +61,6 @@ flutter {
6261
dependencies {
6362
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
6463
testImplementation 'junit:junit:4.12'
65-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
66-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
64+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
65+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
6766
}

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.2.71'
2+
ext.kotlin_version = '1.3.10'
33
repositories {
44
google()
55
jcenter()
66
}
77

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

example/android/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
org.gradle.jvmargs=-Xmx1536M
22

3+
android.enableR8=true
4+
android.useAndroidX=true
5+
android.enableJetifier=true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
1+
#Thu Mar 05 15:38:22 CET 2020
22
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-4.10.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

example/ios/Podfile

Lines changed: 50 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Using a CDN with CocoaPods 1.7.2 or later can save a lot of time on pod installation, but it's experimental rather than the default.
2-
# source 'https://cdn.cocoapods.org/'
3-
41
# Uncomment this line to define a global platform for your project
52
# platform :ios, '9.0'
63

@@ -18,51 +15,67 @@ def parse_KV_file(file, separator='=')
1815
if !File.exists? file_abs_path
1916
return [];
2017
end
21-
pods_ary = []
18+
generated_key_values = {}
2219
skip_line_start_symbols = ["#", "/"]
23-
File.foreach(file_abs_path) { |line|
24-
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
25-
plugin = line.split(pattern=separator)
26-
if plugin.length == 2
27-
podname = plugin[0].strip()
28-
path = plugin[1].strip()
29-
podpath = File.expand_path("#{path}", file_abs_path)
30-
pods_ary.push({:name => podname, :path => podpath});
31-
else
32-
puts "Invalid plugin specification: #{line}"
33-
end
34-
}
35-
return pods_ary
20+
File.foreach(file_abs_path) do |line|
21+
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22+
plugin = line.split(pattern=separator)
23+
if plugin.length == 2
24+
podname = plugin[0].strip()
25+
path = plugin[1].strip()
26+
podpath = File.expand_path("#{path}", file_abs_path)
27+
generated_key_values[podname] = podpath
28+
else
29+
puts "Invalid plugin specification: #{line}"
30+
end
31+
end
32+
generated_key_values
3633
end
3734

3835
target 'Runner' do
3936
use_frameworks!
37+
use_modular_headers!
38+
39+
# Flutter Pod
4040

41-
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
42-
# referring to absolute paths on developers' machines.
43-
system('rm -rf .symlinks')
44-
system('mkdir -p .symlinks/plugins')
41+
copied_flutter_dir = File.join(__dir__, 'Flutter')
42+
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
43+
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
44+
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
45+
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
46+
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
47+
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
4548

46-
# Flutter Pods
47-
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
48-
if generated_xcode_build_settings.empty?
49-
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
50-
end
51-
generated_xcode_build_settings.map { |p|
52-
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
53-
symlink = File.join('.symlinks', 'flutter')
54-
File.symlink(File.dirname(p[:path]), symlink)
55-
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
49+
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
50+
unless File.exist?(generated_xcode_build_settings_path)
51+
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
5652
end
57-
}
53+
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
54+
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
55+
56+
unless File.exist?(copied_framework_path)
57+
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
58+
end
59+
unless File.exist?(copied_podspec_path)
60+
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
61+
end
62+
end
63+
64+
# Keep pod path relative so it can be checked into Podfile.lock.
65+
pod 'Flutter', :path => 'Flutter'
5866

5967
# Plugin Pods
68+
69+
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
70+
# referring to absolute paths on developers' machines.
71+
system('rm -rf .symlinks')
72+
system('mkdir -p .symlinks/plugins')
6073
plugin_pods = parse_KV_file('../.flutter-plugins')
61-
plugin_pods.map { |p|
62-
symlink = File.join('.symlinks', 'plugins', p[:name])
63-
File.symlink(p[:path], symlink)
64-
pod p[:name], :path => File.join(symlink, 'ios')
65-
}
74+
plugin_pods.each do |name, path|
75+
symlink = File.join('.symlinks', 'plugins', name)
76+
File.symlink(path, symlink)
77+
pod name, :path => File.join(symlink, 'ios')
78+
end
6679
end
6780

6881
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.

example/ios/Podfile.lock

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ PODS:
22
- apple_maps_flutter (0.0.1):
33
- Flutter
44
- Flutter (1.0.0)
5+
- flutter_plugin_android_lifecycle (0.0.1):
6+
- Flutter
57
- google_maps_flutter (0.0.1):
68
- Flutter
79
- GoogleMaps
@@ -13,7 +15,8 @@ PODS:
1315

1416
DEPENDENCIES:
1517
- apple_maps_flutter (from `.symlinks/plugins/apple_maps_flutter/ios`)
16-
- Flutter (from `.symlinks/flutter/ios`)
18+
- Flutter (from `Flutter`)
19+
- flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
1720
- google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`)
1821

1922
SPEC REPOS:
@@ -24,16 +27,19 @@ EXTERNAL SOURCES:
2427
apple_maps_flutter:
2528
:path: ".symlinks/plugins/apple_maps_flutter/ios"
2629
Flutter:
27-
:path: ".symlinks/flutter/ios"
30+
:path: Flutter
31+
flutter_plugin_android_lifecycle:
32+
:path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
2833
google_maps_flutter:
2934
:path: ".symlinks/plugins/google_maps_flutter/ios"
3035

3136
SPEC CHECKSUMS:
3237
apple_maps_flutter: 45925bdf704b86f713fcf6979ee1999d17b2a6e0
3338
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
34-
google_maps_flutter: 78a52114c898b42ea647919679a4c58b70abe876
39+
flutter_plugin_android_lifecycle: 47de533a02850f070f5696a623995e93eddcdb9b
40+
google_maps_flutter: d0dd62f5a7d39bae61057eb9f52dd778d99c7c6c
3541
GoogleMaps: f79af95cb24d869457b1f961c93d3ce8b2f3b848
3642

37-
PODFILE CHECKSUM: 10ae9c18d12c9ffc2275c9a159a3b1e281990db0
43+
PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83
3844

3945
COCOAPODS: 1.8.3

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
729441750D12482C4D29D068 /* Pods-Runner.release.xcconfig */,
8888
EBA65092DBD8FDD261FAFFD0 /* Pods-Runner.profile.xcconfig */,
8989
);
90-
name = Pods;
9190
path = Pods;
9291
sourceTree = "<group>";
9392
};
@@ -183,7 +182,8 @@
183182
TargetAttributes = {
184183
97C146ED1CF9000F007C117D = {
185184
CreatedOnToolsVersion = 7.3.1;
186-
LastSwiftMigration = 0910;
185+
DevelopmentTeam = PT2UDFM269;
186+
LastSwiftMigration = 1130;
187187
};
188188
};
189189
};
@@ -392,6 +392,7 @@
392392
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
393393
CLANG_ENABLE_MODULES = YES;
394394
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
395+
DEVELOPMENT_TEAM = PT2UDFM269;
395396
ENABLE_BITCODE = NO;
396397
FRAMEWORK_SEARCH_PATHS = (
397398
"$(inherited)",
@@ -406,7 +407,7 @@
406407
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterPlatformMapsExample;
407408
PRODUCT_NAME = "$(TARGET_NAME)";
408409
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
409-
SWIFT_VERSION = 4.0;
410+
SWIFT_VERSION = 5.0;
410411
VERSIONING_SYSTEM = "apple-generic";
411412
};
412413
name = Profile;
@@ -525,6 +526,7 @@
525526
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
526527
CLANG_ENABLE_MODULES = YES;
527528
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
529+
DEVELOPMENT_TEAM = PT2UDFM269;
528530
ENABLE_BITCODE = NO;
529531
FRAMEWORK_SEARCH_PATHS = (
530532
"$(inherited)",
@@ -540,7 +542,7 @@
540542
PRODUCT_NAME = "$(TARGET_NAME)";
541543
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
542544
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
543-
SWIFT_VERSION = 4.0;
545+
SWIFT_VERSION = 5.0;
544546
VERSIONING_SYSTEM = "apple-generic";
545547
};
546548
name = Debug;
@@ -552,6 +554,7 @@
552554
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
553555
CLANG_ENABLE_MODULES = YES;
554556
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
557+
DEVELOPMENT_TEAM = PT2UDFM269;
555558
ENABLE_BITCODE = NO;
556559
FRAMEWORK_SEARCH_PATHS = (
557560
"$(inherited)",
@@ -566,7 +569,7 @@
566569
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterPlatformMapsExample;
567570
PRODUCT_NAME = "$(TARGET_NAME)";
568571
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
569-
SWIFT_VERSION = 4.0;
572+
SWIFT_VERSION = 5.0;
570573
VERSIONING_SYSTEM = "apple-generic";
571574
};
572575
name = Release;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

example/pubspec.lock

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: apple_maps_flutter
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "0.0.6+2"
10+
version: "0.0.6+4"
1111
archive:
1212
dependency: transitive
1313
description:
@@ -70,12 +70,19 @@ packages:
7070
name: cupertino_icons
7171
url: "https://pub.dartlang.org"
7272
source: hosted
73-
version: "0.1.2"
73+
version: "0.1.3"
7474
flutter:
7575
dependency: "direct main"
7676
description: flutter
7777
source: sdk
7878
version: "0.0.0"
79+
flutter_plugin_android_lifecycle:
80+
dependency: transitive
81+
description:
82+
name: flutter_plugin_android_lifecycle
83+
url: "https://pub.dartlang.org"
84+
source: hosted
85+
version: "1.0.6"
7986
flutter_test:
8087
dependency: "direct dev"
8188
description: flutter
@@ -87,7 +94,7 @@ packages:
8794
name: google_maps_flutter
8895
url: "https://pub.dartlang.org"
8996
source: hosted
90-
version: "0.5.21+7"
97+
version: "0.5.24+1"
9198
image:
9299
dependency: transitive
93100
description:
@@ -214,4 +221,4 @@ packages:
214221
version: "3.5.0"
215222
sdks:
216223
dart: ">=2.4.0 <3.0.0"
217-
flutter: ">=1.5.0 <2.0.0"
224+
flutter: ">=1.12.13+hotfix.5 <2.0.0"

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: apple_maps_flutter
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "0.0.6+2"
10+
version: "0.0.6+4"
1111
archive:
1212
dependency: transitive
1313
description:
@@ -200,4 +200,4 @@ packages:
200200
version: "3.5.0"
201201
sdks:
202202
dart: ">=2.4.0 <3.0.0"
203-
flutter: ">=1.5.0 <2.0.0"
203+
flutter: ">=1.10.0 <2.0.0"

0 commit comments

Comments
 (0)