Comments (3)
flutter_flipperkit
does not support global interception of http
- Set
useHttpOverrides
tofalse
import 'package:flutter_flipperkit/flutter_flipperkit.dart';
void main() {
FlipperClient flipperClient = FlipperClient.getDefault();
flipperClient.addPlugin(new FlipperNetworkPlugin(
// If you use http library, you must set it to false and use https://pub.dev/packages/flipperkit_http_interceptor
useHttpOverrides: false,
));
flipperClient.start();
runApp(MyApp());
}
...
- Use flipperkit_http_interceptor instead of http
import 'package:flipperkit_http_interceptor/flipperkit_http_interceptor.dart';
var http = HttpClientWithInterceptor();
http.get("https://www.v2ex.com/api/topics/hot.json");
You don't need to add any Flipper Setup code to AppDelegate.m, flutter_flipperkit will handle these.
Please see http_example
from flutter_flipperkit.
Thanks for the response, that clarifies things a bit.
I updated my example repo with your suggestions and I get the following build error:
Compiler message:
file:///Users/mitchell/bin/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_flipperkit-0.0.17/lib/plugins/network/flipper_http_client_response.dart:7:7: Error: The non-abstract class 'FlipperHttpClientResponse' is missing implementations for these members:
- HttpClientResponse.compressionState
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class FlipperHttpClientResponse extends Stream<List<int>> implements HttpClientResponse {
^^^^^^^^^^^^^^^^^^^^^^^^^
org-dartlang-sdk:///third_party/dart/sdk/lib/_http/http.dart:1967:42: Context: 'HttpClientResponse.compressionState' is defined here.
HttpClientResponseCompressionState get compressionState;
^^^^^^^^^^^^^^^^
Compiler failed on /Users/mitchell/viv/src/flipper_example/lib/main.dart
Error launching application on iPhone Xʀ.
Exited (sigterm)
My example repo has been updated here: https://github.com/mtchllbrrn/flipper_example
from flutter_flipperkit.
@mtchllbrrn please upgrade flutter(use beta or stable) and upgrade flutter_flipperkit to 0.0.19
Change your Podifle file
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
-flipperkit_version = '0.22.0'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
pods_ary = []
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
end
target 'Runner' do
# 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')
# 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 packages 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]))
end
}
- # Enable network inspection for Flipper
- pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version
# Plugin Pods
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')
}
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
- file_name = Dir.glob("*.xcodeproj")[0]
- app_project = Xcodeproj::Project.open(file_name)
- app_project.native_targets.each do |target|
- target.build_configurations.each do |config|
- if (config.build_settings['OTHER_SWIFT_FLAGS'])
- unless config.build_settings['OTHER_SWIFT_FLAGS'].include? '-DFB_SONARKIT_ENABLED'
- puts 'Adding -DFB_SONARKIT_ENABLED ...'
- swift_flags = config.build_settings['OTHER_SWIFT_FLAGS']
- if swift_flags.split.last != '-Xcc'
- config.build_settings['OTHER_SWIFT_FLAGS'] << ' -Xcc'
- end
- config.build_settings['OTHER_SWIFT_FLAGS'] << ' -DFB_SONARKIT_ENABLED'
- end
- else
- puts 'OTHER_SWIFT_FLAGS does not exist thus assigning it to `$(inherited) -Xcc -DFB_SONARKIT_ENABLED`'
- config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -Xcc -DFB_SONARKIT_ENABLED'
-
- file_name = Dir.glob("*.xcodeproj")[0]
- app_project = Xcodeproj::Project.open(file_name)
- app_project.native_targets.each do |target|
- target.build_configurations.each do |config|
- if (config.build_settings['OTHER_SWIFT_FLAGS'])
- unless config.build_settings['OTHER_SWIFT_FLAGS'].include? '-DFB_SONARKIT_ENABLED'
- puts 'Adding -DFB_SONARKIT_ENABLED ...'
- swift_flags = config.build_settings['OTHER_SWIFT_FLAGS']
- if swift_flags.split.last != '-Xcc'
- config.build_settings['OTHER_SWIFT_FLAGS'] << ' -Xcc'
- end
- config.build_settings['OTHER_SWIFT_FLAGS'] << ' -DFB_SONARKIT_ENABLED'
- end
- else
- puts 'OTHER_SWIFT_FLAGS does not exist thus assigning it to `$(inherited) -Xcc -DFB_SONARKIT_ENABLED`'
- config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -Xcc -DFB_SONARKIT_ENABLED'
- end
- app_project.save
- end
- end
- installer.pods_project.save
- end
- app_project.save
- end
- end
- installer.pods_project.save
end
from flutter_flipperkit.
Related Issues (20)
- How to set up with new style settings.gradle file on Android? HOT 1
- New pod format support HOT 2
- [Flutter v1.22] Cannot build HOT 2
- Error building iOS app after Flutter (1.22.1) upgrade HOT 13
- Plugins seem to not be working on flipper 0.72.0 HOT 3
- Not able to Build iOS default flutter app HOT 2
- Upgrade to uuid ^3.0.1 HOT 1
- Not working with --profile flag HOT 4
- fatal error: 'boost/preprocessor/control/expr_iif.hpp' file not found HOT 1
- Watchman: Watchman was not found in PATH. See https://facebook.github.io/watchman/docs/install.html for installation instructions HOT 2
- iOS error when building as static library HOT 8
- symbol(s) not found for architecture x86_64 HOT 1
- Can't build Android with Gradle Build Tools 4.2.1 HOT 3
- Conflict with other dependencies HOT 2
- HttpClient的签名发生了改变 HOT 1
- ios 启动报错 HOT 3
- How to mock network in flutter using flipper
- Project run throws " The non-abstract class 'FlipperHttpClient' is missing implementations " HOT 2
- Use of bitwise '|' with boolean operands | XCode 14.3 fails builds using Yoga, If there is a need to use an old version Yoga, an older version of XCode is required.
- CKNonNull.h:47:33 No member named 'move' in namespace 'std'; did you mean 'modf'?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_flipperkit.