Skip to content

Commit

Permalink
fix for Flutter 1.12.13+hotfix.5
Browse files Browse the repository at this point in the history
  • Loading branch information
iamyours committed Jan 9, 2020
1 parent d464608 commit 0872599
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 50 deletions.
1 change: 1 addition & 0 deletions .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"iwebview_flutter","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]}]}
2 changes: 2 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
implementation 'androidx.lifecycle:lifecycle-runtime:2.1.0'
implementation 'androidx.core:core:1.1.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
6 changes: 6 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ buildscript {
repositories {
google()
jcenter()
maven {
url 'http://download.flutter.io'
}
}

dependencies {
Expand All @@ -15,6 +18,9 @@ allprojects {
repositories {
google()
jcenter()
maven {
url 'http://download.flutter.io'
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
org.gradle.jvmargs=-Xmx1536M

android.enableR8=true

android.useAndroidX=true
android.enableJetifier=true
1 change: 1 addition & 0 deletions android/settings_aar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
18 changes: 18 additions & 0 deletions ios/Flutter/Flutter.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# NOTE: This podspec is NOT to be published. It is only used as a local source!
#

Pod::Spec.new do |s|
s.name = 'Flutter'
s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.'
s.description = <<-DESC
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
DESC
s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => '[email protected]' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.vendored_frameworks = 'Flutter.framework'
end
87 changes: 50 additions & 37 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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.
# source 'https://cdn.cocoapods.org/'

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

Expand All @@ -18,51 +15,67 @@ def parse_KV_file(file, separator='=')
if !File.exists? file_abs_path
return [];
end
pods_ary = []
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end
generated_key_values
end

target 'Runner' do
use_frameworks!
use_modular_headers!

# Flutter Pod

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

# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
}
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];

unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end

# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'

# Plugin Pods

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
Expand Down
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PODS:
- FMDB (~> 2.7.2)

DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`)
- Flutter (from `Flutter`)
- iwebview_flutter (from `.symlinks/plugins/iwebview_flutter/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
Expand All @@ -23,7 +23,7 @@ SPEC REPOS:

EXTERNAL SOURCES:
Flutter:
:path: ".symlinks/flutter/ios"
:path: Flutter
iwebview_flutter:
:path: ".symlinks/plugins/iwebview_flutter/ios"
shared_preferences:
Expand All @@ -38,6 +38,6 @@ SPEC CHECKSUMS:
shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01
sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a

PODFILE CHECKSUM: 10ae9c18d12c9ffc2275c9a159a3b1e281990db0
PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83

COCOAPODS: 1.8.4
72 changes: 63 additions & 9 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.33.6+1"
archive:
dependency: transitive
description:
name: archive
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.11"
args:
dependency: transitive
description:
Expand All @@ -21,7 +28,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.0"
version: "2.4.0"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -179,6 +186,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
front_end:
dependency: transitive
description:
Expand Down Expand Up @@ -221,6 +233,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.3"
image:
dependency: transitive
description:
name: image
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
io:
dependency: transitive
description:
Expand All @@ -231,9 +250,9 @@ packages:
iwebview_flutter:
dependency: "direct main"
description:
path: "../plugins/webview_flutter-0.3.15+1"
relative: true
source: path
name: iwebview_flutter
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.4"
js:
dependency: transitive
Expand Down Expand Up @@ -276,14 +295,14 @@ packages:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.5"
version: "0.12.6"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.7"
version: "1.1.8"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -326,6 +345,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.0"
plugin:
dependency: transitive
description:
Expand Down Expand Up @@ -374,7 +400,28 @@ packages:
name: shared_preferences
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.5.4"
version: "0.5.6"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.1+3"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.2+2"
shelf:
dependency: transitive
description:
Expand Down Expand Up @@ -463,7 +510,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.5"
version: "0.2.11"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -513,6 +560,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.5.0"
yaml:
dependency: transitive
description:
Expand All @@ -522,4 +576,4 @@ packages:
version: "2.2.0"
sdks:
dart: ">2.4.0 <3.0.0"
flutter: ">=1.6.7 <2.0.0"
flutter: ">=1.12.13+hotfix.4 <2.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
pull_to_refresh: 1.5.7
dio: 3.0.3
flutter_swiper: 1.1.6
shared_preferences: 0.5.4
shared_preferences: 0.5.6
sqflite: 1.1.0
iwebview_flutter: 0.1.4
flutter_html: 0.8.2
Expand Down

0 comments on commit 0872599

Please sign in to comment.