Skip to content

What should be the domainNetworkPolicy while using flutter in existing iOS App? #65580

@vamsi452

Description

@vamsi452

I have NSAppTransportSecurity already added with NSAllowsArbitraryLoads as "YES" and some "NSExceptionDomains"

App is crashing while initializing flutter engine:

+[FlutterDartProject domainNetworkPolicy:] + 352

Steps to Reproduce

  1. Add App transport security to iOS Native app in info.plist

  2. Set NSAllowsArbitraryLoads to YES

  3. Add NSExceptionDomains dictionary

NSExceptionDomains

NSTemporaryExceptionAllowInsecureHTTPLoads

www.cloudflare.com

NSExceptionAllowsInsecureHTTPLoads

NSIncludesSubdomains

NSTemporaryExceptionMinimumTLSVersion
TLSv1.1
NSThirdPartyExceptionAllowsInsecureHTTPLoads


Logs

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean objectForKey:]: unrecognized selector sent to instance 0x7fff80634458'

*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff23e3de6e __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff512539b2 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff23e5eb94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff23e4286c ___forwarding___ + 1436
	4   CoreFoundation                      0x00007fff23e44b58 _CF_forwarding_prep_0 + 120
	5   Flutter                             0x000000010a949967 +[FlutterDartProject domainNetworkPolicy:] + 352
	6   Flutter                             0x000000010a948db5 -[FlutterDartProject initWithPrecompiledDartBundle:] + 1371
	7   Flutter                             0x000000010a94b169 -[FlutterEngine initWithName:project:allowHeadlessExecution:] + 218
	8   USMLE                               0x0000000106ef4bbf -[AppDelegate application:didFinishLaunchingWithOptions:] + 111

The output of running flutter doctor -v

DevOps-MBP1:ios_fc vkallepalli$ flutter doctor -v
[✓] Flutter (Channel master, 1.22.0-10.0.pre.72, on Mac OS X 10.15.5 19F101, locale en-US)
    • Flutter version 1.22.0-10.0.pre.72 at /Users/vkallepalli/flutter
    • Framework revision bd3eee75f3 (7 days ago), 2020-09-03 11:55:55 -0700
    • Engine revision 165abef0a2
    • Dart version 2.10.0 (build 2.10.0-77.0.dev)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/vkallepalli/Library/Android/sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.48.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.14.0

Please help!

Metadata

Metadata

Assignees

Labels

in triagePresently being triaged by the triage team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions