[GH-ISSUE #1582] [Bug] cargo Build errors on MacOS: lib/src/resolver.dart:271:31: Error: The getter 'source' isn't defined for the class 'String? #611

Closed
opened 2026-03-23 20:38:41 +00:00 by mirror · 5 comments
Owner

Originally created by @itinance on GitHub (Dec 18, 2022).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1582

Bug Description

When building for release, the following build error occur:

Failed to build build_runner:build_runner:
../../../../../.pub-cache/hosted/pub.dartlang.org/build_resolvers-2.1.0/lib/src/resolver.dart:271:31: Error: The getter 'source' isn't defined for the class 'String?'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'source'.
      existingSources.add(uri.source);
                              ^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/build_resolvers-2.1.0/lib/src/resolver.dart:310:19: Error: The getter 'sdkLibraryUris' isn't defined for the class 'AnalysisDriverForPackageBuild'.
 - 'AnalysisDriverForPackageBuild' is from 'package:analyzer/src/clients/build_resolvers/build_resolvers.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-4.7.0/lib/src/clients/build_resolvers/build_resolvers.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'sdkLibraryUris'.
          _driver.sdkLibraryUris.where((e) => !e.path.startsWith('_'));
                  ^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/build_resolvers-2.1.0/lib/src/resolver.dart:469:13: Error: Method not found: 'buildSdkSummary'.
      await buildSdkSummary(
            ^^^^^^^^^^^^^^^
pub finished with exit code 1
[cargo-make][1] ERROR - Error while executing command, exit code: 1

How to Reproduce

cargo make --profile production-mac-x86_64 appflowy

Expected Behavior

it builds.

Operating System

MacOS Ventura 13.0.1

AppFlowy Version(s)

master

Screenshots

Screenshot 2022-12-18 at 21 48 47

Additional Context

Versions:

Flutter 3.3.10 • channel stable • git@github.com:flutter/flutter.git
Framework • revision 135454af32 (3 days ago) • 2022-12-15 07:36:55 -0800
Engine • revision 3316dd8728
Tools • Dart 2.18.6 • DevTools 2.15.0
cargo 1.66.0 (d65d197ad 2022-11-15)
Originally created by @itinance on GitHub (Dec 18, 2022). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1582 ### Bug Description When building for release, the following build error occur: ``` Failed to build build_runner:build_runner: ../../../../../.pub-cache/hosted/pub.dartlang.org/build_resolvers-2.1.0/lib/src/resolver.dart:271:31: Error: The getter 'source' isn't defined for the class 'String?'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'source'. existingSources.add(uri.source); ^^^^^^ ../../../../../.pub-cache/hosted/pub.dartlang.org/build_resolvers-2.1.0/lib/src/resolver.dart:310:19: Error: The getter 'sdkLibraryUris' isn't defined for the class 'AnalysisDriverForPackageBuild'. - 'AnalysisDriverForPackageBuild' is from 'package:analyzer/src/clients/build_resolvers/build_resolvers.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/analyzer-4.7.0/lib/src/clients/build_resolvers/build_resolvers.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'sdkLibraryUris'. _driver.sdkLibraryUris.where((e) => !e.path.startsWith('_')); ^^^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dartlang.org/build_resolvers-2.1.0/lib/src/resolver.dart:469:13: Error: Method not found: 'buildSdkSummary'. await buildSdkSummary( ^^^^^^^^^^^^^^^ pub finished with exit code 1 [cargo-make][1] ERROR - Error while executing command, exit code: 1 ``` ### How to Reproduce `cargo make --profile production-mac-x86_64 appflowy` ### Expected Behavior it builds. ### Operating System MacOS Ventura 13.0.1 ### AppFlowy Version(s) master ### Screenshots <img width="1402" alt="Screenshot 2022-12-18 at 21 48 47" src="https://user-images.githubusercontent.com/1758597/208318635-af636d43-6ea3-4759-aaf1-9a7b1a144f8e.png"> ### Additional Context Versions: ``` Flutter 3.3.10 • channel stable • git@github.com:flutter/flutter.git Framework • revision 135454af32 (3 days ago) • 2022-12-15 07:36:55 -0800 Engine • revision 3316dd8728 Tools • Dart 2.18.6 • DevTools 2.15.0 cargo 1.66.0 (d65d197ad 2022-11-15) ```
Author
Owner

@LucasXu0 commented on GitHub (Dec 19, 2022):

HI, @itinance. Please use the below version and check again.

Flutter '3.0.5'
Rust 'stable-2022-04-07'

For more information, you can refer to https://github.com/AppFlowy-IO/AppFlowy/blob/main/.github/workflows/release.yml.

<!-- gh-comment-id:1357354227 --> @LucasXu0 commented on GitHub (Dec 19, 2022): HI, @itinance. Please use the below version and check again. Flutter '3.0.5' Rust 'stable-2022-04-07' For more information, you can refer to https://github.com/AppFlowy-IO/AppFlowy/blob/main/.github/workflows/release.yml.
Author
Owner

@appflowy commented on GitHub (Jan 7, 2023):

@itinance AppFlowy is support 3.3.10. You can pull the latest code and try again.

<!-- gh-comment-id:1374352714 --> @appflowy commented on GitHub (Jan 7, 2023): @itinance AppFlowy is support 3.3.10. You can pull the latest code and try again.
Author
Owner

@itinance commented on GitHub (Jan 7, 2023):

Hey, thanks.

cargo make --profile production-mac-arm64 appflowy works perfectly and builds now.

However, flutter run, whether done via CLI, MS Code, or Android Studio will still not find any dart:ffi when building for Web.

Isn't Appflowy supposed to get built also as a pure web application?

packages/flowy_sdk/lib/flowy_sdk.dart:6:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
packages/flowy_sdk/lib/dispatch/dispatch.dart:1:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
packages/flowy_sdk/lib/rust_stream.dart:4:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
packages/flowy_sdk/lib/ffi.dart:3:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
../../../../../.pub-cache/hosted/pub.dartlang.org/ffi-1.2.1/lib/src/allocation.dart:5:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
../../../../../.pub-cache/hosted/pub.dartlang.org/ffi-1.2.1/lib/src/arena.dart:8:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
../../../../../.pub-cache/hosted/pub.dartlang.org/ffi-1.2.1/lib/src/utf8.dart:6:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
../../../../../.pub-cache/hosted/pub.dartlang.org/ffi-1.2.1/lib/src/utf16.dart:5:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';

<!-- gh-comment-id:1374495584 --> @itinance commented on GitHub (Jan 7, 2023): Hey, thanks. `cargo make --profile production-mac-arm64 appflowy` works perfectly and builds now. However, `flutter run`, whether done via CLI, MS Code, or Android Studio will still not find any `dart:ffi` when building for Web. Isn't Appflowy supposed to get built also as a pure web application? ``` packages/flowy_sdk/lib/flowy_sdk.dart:6:8: Error: Not found: 'dart:ffi' import 'dart:ffi'; ^ packages/flowy_sdk/lib/dispatch/dispatch.dart:1:8: Error: Not found: 'dart:ffi' import 'dart:ffi'; ^ packages/flowy_sdk/lib/rust_stream.dart:4:8: Error: Not found: 'dart:ffi' import 'dart:ffi'; ^ packages/flowy_sdk/lib/ffi.dart:3:8: Error: Not found: 'dart:ffi' import 'dart:ffi'; ^ ../../../../../.pub-cache/hosted/pub.dartlang.org/ffi-1.2.1/lib/src/allocation.dart:5:8: Error: Not found: 'dart:ffi' import 'dart:ffi'; ^ ../../../../../.pub-cache/hosted/pub.dartlang.org/ffi-1.2.1/lib/src/arena.dart:8:8: Error: Not found: 'dart:ffi' import 'dart:ffi'; ^ ../../../../../.pub-cache/hosted/pub.dartlang.org/ffi-1.2.1/lib/src/utf8.dart:6:8: Error: Not found: 'dart:ffi' import 'dart:ffi'; ^ ../../../../../.pub-cache/hosted/pub.dartlang.org/ffi-1.2.1/lib/src/utf16.dart:5:8: Error: Not found: 'dart:ffi' import 'dart:ffi'; ```
Author
Owner

@richardshiue commented on GitHub (Jan 7, 2023):

Hey there @itinance, currently, the Flutter application only supports desktops (i.e. Mac, Windows and Linux). Support for mobile (Android, iOS) and Web are not ready as yet

<!-- gh-comment-id:1374524584 --> @richardshiue commented on GitHub (Jan 7, 2023): Hey there @itinance, currently, the Flutter application only supports desktops (i.e. Mac, Windows and Linux). Support for mobile (Android, iOS) and Web are not ready as yet
Author
Owner

@annieappflowy commented on GitHub (Dec 24, 2023):

we now support mobile

<!-- gh-comment-id:1868556164 --> @annieappflowy commented on GitHub (Dec 24, 2023): we now support mobile
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#611
No description provided.