Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
350 views
in Technique[技术] by (71.8m points)

Flutter: Too many open files exception (MacOS)

Today I saw a strange error in my app, it is something like this

FileSystemException: FileSystemException: Getting current working directory failed, path = '' (OS Error: Too many open files in system, errno = 23)

My app has a huge number of assets, maybe it is the cause of this issue?

This feels like two separate issues. One is our holding of the package:test code on Mac and trying to drive too many tests at once

flutter doctor

[?] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB)
    ? Flutter version 1.22.5 at /Users/mac/Development/flutter
    ? Framework revision 7891006299 (4 weeks ago), 2020-12-10 11:54:40 -0800
    ? Engine revision ae90085a84
    ? Dart version 2.10.4

 
[?] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ? Android SDK at /Users/mac/Library/Android/sdk
    ? Platform android-30, build-tools 30.0.3
    ? Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    ? Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    ? All Android licenses accepted.

[?] Xcode - develop for iOS and macOS (Xcode 12.0)
    ? Xcode at /Applications/Xcode.app/Contents/Developer
    ? Xcode 12.0, Build version 12A7209
    ? CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
    ? Android Studio at /Applications/Android Studio.app/Contents
    ? Flutter plugin not installed; this adds Flutter specific functionality.
    ? Dart plugin not installed; this adds Dart specific functionality.
    ? Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

How to Change Open Files Limit on macOS?

question from:https://stackoverflow.com/questions/65660812/flutter-too-many-open-files-exception-macos

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The default limit for Mac OS on how many files it can have open at a time is rather low. If you run into this limit, increase the number of available file handlers using the ulimit command:

ulimit -S -n 2048

If you use Travis or Cirrus for testing, increase the number of available file handlers that they can open by adding the same line to flutter/.travis.yml, or flutter/.cirrus.yml, respectively.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...