Skip to content

Commit b5dedae

Browse files
committed
update.
1 parent aa6f320 commit b5dedae

File tree

4 files changed

+65
-38
lines changed

4 files changed

+65
-38
lines changed

android/app/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
2525
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

2727
android {
28-
compileSdkVersion 27
28+
compileSdkVersion 28
2929

3030
lintOptions {
3131
disable 'InvalidPackage'
@@ -35,7 +35,7 @@ android {
3535
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3636
applicationId "com.cloudwebrtc.flutterwebrtcdemo"
3737
minSdkVersion 18
38-
targetSdkVersion 27
38+
targetSdkVersion 28
3939
versionCode flutterVersionCode.toInteger()
4040
versionName flutterVersionName
4141
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -53,6 +53,9 @@ android {
5353
signingConfig signingConfigs.debug
5454
}
5555
}
56+
packagingOptions {
57+
exclude 'META-INF/proguard/androidx-annotations.pro'
58+
}
5659
}
5760

5861
flutter {

android/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
2+
android.enableR8=true
3+
android.useAndroidX=true
4+
android.enableJetifier=true

ios/Podfile

Lines changed: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,78 @@
11
# Uncomment this line to define a global platform for your project
2-
platform :ios, '9.0'
2+
# platform :ios, '9.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
66

7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
713
def parse_KV_file(file, separator='=')
814
file_abs_path = File.expand_path(file)
915
if !File.exists? file_abs_path
1016
return [];
1117
end
12-
pods_ary = []
18+
generated_key_values = {}
1319
skip_line_start_symbols = ["#", "/"]
14-
File.foreach(file_abs_path) { |line|
15-
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
16-
plugin = line.split(pattern=separator)
17-
if plugin.length == 2
18-
podname = plugin[0].strip()
19-
path = plugin[1].strip()
20-
podpath = File.expand_path("#{path}", file_abs_path)
21-
pods_ary.push({:name => podname, :path => podpath});
22-
else
23-
puts "Invalid plugin specification: #{line}"
24-
end
25-
}
26-
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
2733
end
2834

2935
target 'Runner' do
30-
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
31-
# referring to absolute paths on developers' machines.
32-
system('rm -rf .symlinks')
33-
system('mkdir -p .symlinks/plugins')
36+
# Flutter Pod
3437

35-
# Flutter Pods
36-
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
37-
if generated_xcode_build_settings.empty?
38-
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
39-
end
40-
generated_xcode_build_settings.map { |p|
41-
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
42-
symlink = File.join('.symlinks', 'flutter')
43-
File.symlink(File.dirname(p[:path]), symlink)
44-
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
38+
copied_flutter_dir = File.join(__dir__, 'Flutter')
39+
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
40+
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
41+
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
42+
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
43+
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
44+
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
45+
46+
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
47+
unless File.exist?(generated_xcode_build_settings_path)
48+
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
49+
end
50+
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
51+
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
52+
53+
unless File.exist?(copied_framework_path)
54+
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
55+
end
56+
unless File.exist?(copied_podspec_path)
57+
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
4558
end
46-
}
59+
end
60+
61+
# Keep pod path relative so it can be checked into Podfile.lock.
62+
pod 'Flutter', :path => 'Flutter'
4763

4864
# Plugin Pods
65+
66+
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
67+
# referring to absolute paths on developers' machines.
68+
system('rm -rf .symlinks')
69+
system('mkdir -p .symlinks/plugins')
4970
plugin_pods = parse_KV_file('../.flutter-plugins')
50-
plugin_pods.map { |p|
51-
symlink = File.join('.symlinks', 'plugins', p[:name])
52-
File.symlink(p[:path], symlink)
53-
pod p[:name], :path => File.join(symlink, 'ios')
54-
}
71+
plugin_pods.each do |name, path|
72+
symlink = File.join('.symlinks', 'plugins', name)
73+
File.symlink(path, symlink)
74+
pod name, :path => File.join(symlink, 'ios')
75+
end
5576
end
5677

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

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
flutter_webrtc:
2323
git:
2424
url: https://github.com/cloudwebrtc/flutter-webrtc.git
25-
shared_preferences:
25+
shared_preferences: 0.5.2
2626

2727
dev_dependencies:
2828
flutter_test:

0 commit comments

Comments
 (0)