Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App fails to compile for macOS #80

Closed
sunsetsonwheels opened this issue Apr 25, 2022 · 12 comments
Closed

App fails to compile for macOS #80

sunsetsonwheels opened this issue Apr 25, 2022 · 12 comments

Comments

@sunsetsonwheels
Copy link

Flutter 2.10.4
Xcode 13.3.1
pdf_render 1.0.23

Launching lib/main.dart on macOS in debug mode...
2022-04-25 13:05:54.663 xcodebuild[90323:5247520] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-04-25 13:05:54.663 xcodebuild[90323:5247520] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:x86_64, id:152E06B4-19FB-5B83-B6D4-9B65A2FE058F }
{ platform:macOS, name:Any Mac }
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
error: emit-module command failed with exit code 1 (use -v to see invocation)
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:1: error: expressions are not allowed at the top level
../../ios/Classes/SwiftPdfRenderPlugin.swift
^
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:1: error: cannot find operator '../../' in scope

../../ios/Classes/SwiftPdfRenderPlugin.swift
^~~~~~
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:7: error: cannot find 'ios' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift

      ^~~
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:11: error: cannot find 'Classes' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
          ^~~~~~~
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:19: error: cannot find 'SwiftPdfRenderPlugin' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift

                  ^~~~~~~~~~~~~~~~~~~~
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:1: error: expressions are not allowed at the top level
../../ios/Classes/SwiftPdfRenderPlugin.swift
^
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:1: error: cannot find operator '../../' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift

^~~~~~
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:7: error: cannot find 'ios' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
      ^~~
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:11: error: cannot find 'Classes' in scope

../../ios/Classes/SwiftPdfRenderPlugin.swift
          ^~~~~~~
/usr/local/Caskroom/flutter/2.10.0/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.0.23/macos/Classes/SwiftPdfRenderPlugin.swift:1:19: error: cannot find 'SwiftPdfRenderPlugin' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
                  ^~~~~~~~~~~~~~~~~~~~

Command EmitSwiftModule failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
** BUILD FAILED **

Exception: Build process failed
Exited (sigterm)
@consciousmayank
Copy link

Same thing for me too.

@ThomasAunvik
Copy link

ThomasAunvik commented Sep 9, 2022

Same issue here on
Flutter 3.3.1
Xcode 13.4.1
pdf_render 1.3.1

Deployment Target: 10.15

@espresso3389
Copy link
Owner

Do flutter clean on your project directory and rebuild.

@ThomasAunvik
Copy link

Same issue

@ThomasAunvik
Copy link

ThomasAunvik commented Sep 10, 2022

Attaching a log here if it provides any more useful info

Attached Log
> flutter clean
Cleaning Xcode workspace...                                         4.4s
Cleaning Xcode workspace...                                      2,350ms
Deleting build...                                                1,193ms
Deleting .dart_tool...                                             124ms
Deleting Generated.xcconfig...                                       0ms
Deleting flutter_export_environment.sh...                            0ms
Deleting Flutter.podspec...                                          0ms
Deleting ephemeral...                                                1ms
Deleting .flutter-plugins-dependencies...                            0ms
Deleting .flutter-plugins...                                         0ms

> flutter run
Multiple devices found:
device1
device2
macOS (desktop)          • macos                                    • darwin-arm64   • macOS
12.5.1 21G83 darwin-arm
Chrome (web)             • chrome                                   • web-javascript • Google
Chrome 105.0.5195.102
[1]: device1
[2]: device2
[3]: macOS (macos)
[4]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 3
Running "flutter pub get" in project...                             4.3s
Launching lib/main.dart on macOS in debug mode...
Running pod install...                                           2,327ms
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00008103-000235583A79001E }
{ platform:macOS, arch:x86_64, id:00008103-000235583A79001E }
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
error: emit-module command failed with exit code 1 (use -v to see invocation)
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:1: error: expressions are not allowed at the top level
../../ios/Classes/SwiftPdfRenderPlugin.swift
^
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:1: error: cannot find operator '../../' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
^~~~~~
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:7: error: cannot find 'ios' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
      ^~~
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:11: error: cannot find 'Classes' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
          ^~~~~~~
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:19: error: cannot find 'SwiftPdfRenderPlugin' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
                  ^~~~~~~~~~~~~~~~~~~~
Command EmitSwiftModule failed with a nonzero exit code
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:1: error: expressions are not allowed at the top level
../../ios/Classes/SwiftPdfRenderPlugin.swift
^
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:1: error: cannot find operator '../../' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
^~~~~~
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:7: error: cannot find 'ios' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
      ^~~
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:11: error: cannot find 'Classes' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
          ^~~~~~~
/Users/thaun/Documents/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift:1:19: error: cannot find 'SwiftPdfRenderPlugin' in scope
../../ios/Classes/SwiftPdfRenderPlugin.swift
                  ^~~~~~~~~~~~~~~~~~~~
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
** BUILD FAILED **

Building macOS application...                                           
Exception: Build process failed

@espresso3389
Copy link
Owner

@ThomasAunvik Could you show me the result of flutter doctor ?

On my env, the following configuration compiles macOS version correctly:

%  flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.1, on macOS 12.5 21G72 darwin-arm, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.71.0-insider)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!

@ThomasAunvik
Copy link

ThomasAunvik commented Sep 10, 2022

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.1, on macOS 12.5.1 21G83 darwin-arm, locale en-NO)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.71.0)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

I've also just tested using the master branch, since i've seen there have been recent changes.
And that works. No issues then.

@espresso3389
Copy link
Owner

Oh, after testing several things, I've found that ~/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift is not correctly checked out as a symlink:

$ xxd ~/.pub-cache/hosted/pub.dartlang.org/pdf_render-1.3.1/macos/Classes/SwiftPdfRenderPlugin.swift
00000000: 2e2e 2f2e 2e2f 696f 732f 436c 6173 7365  ../../ios/Classe
00000010: 732f 5377 6966 7450 6466 5265 6e64 6572  s/SwiftPdfRender
00000020: 506c 7567 696e 2e73 7769 6674            Plugin.swift

@espresso3389
Copy link
Owner

Wow, I realized that if I release the plugin on Windows, uploaded package get broken :(

The symlink issue has been discussed here but no one explain that if plugin is relased under Windows, symlinks will be broken in the uploaded archive...

Anyway, I've uploaded 1.3.2 and it fixes the issue.

@espresso3389
Copy link
Owner

For the later reference (to me): on Windows, we should do the following things before developing something:

@tolotrasamuel
Copy link

This issues happens again on 1.4.5

@espresso3389
Copy link
Owner

@tolotrasamuel Try 1.4.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants