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

[BUG] Cannot build for platform macos #484

Closed
masewo opened this issue Apr 25, 2021 · 1 comment · Fixed by #485
Closed

[BUG] Cannot build for platform macos #484

masewo opened this issue Apr 25, 2021 · 1 comment · Fixed by #485

Comments

@masewo
Copy link
Contributor

masewo commented Apr 25, 2021

Describe the bug
When trying to build an app that includes photo manager 1.1.4 for platform macos then the build fails.

To Reproduce
Steps to reproduce the behavior:

  1. Build for platform macos.

Expected behavior
App builds.

Flutter version
2.0.5

Log

Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:510:37: warning: more '%' conversions than data arguments [-Wformat]
      NSLog(@"Asset download fail: %@");
                                   ~^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:585:35: error: type-id cannot have a name
                  resultHandler:^(UIImage *_Nullable image,
                                  ^~~~~~~
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:585:43: error: expected ')'
                  resultHandler:^(UIImage *_Nullable image,
                                          ^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:585:34: note: to match this '('
                  resultHandler:^(UIImage *_Nullable image,
                                 ^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:585:33: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
                  resultHandler:^(UIImage *_Nullable image,
                                ^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:588:7: error: non-void block should return a value
      return;
      ^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:591:57: error: use of undeclared identifier 'info'
    BOOL downloadFinished = [PMManager isDownloadFinish:info];
                                                        ^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:594:7: error: non-void block should return a value
      return;
      ^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:597:69: error: implicit declaration of function 'UIImageJPEGRepresentation' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    NSString *path = [self writeFullFileWithAssetId:asset imageData:UIImageJPEGRepresentation(image, 1.0)];
                                                                    ^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:597:95: error: use of undeclared identifier 'image'
    NSString *path = [self writeFullFileWithAssetId:asset imageData:UIImageJPEGRepresentation(image, 1.0)];
                                                                                          ^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.m:585:33: error: incompatible block pointer types sending 'int ((^)(void))' to parameter of type 'void (^ _Nonnull)(NSImage * _Nullable __strong, NSDictionary * _Nullable __strong)'
                  resultHandler:^(UIImage *_Nullable image,
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'Photos' imported from /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/photo_manager-1.1.4/macos/Classes/core/PMManager.h:7:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h:160:264: note: passing argument to parameter 'resultHandler' here
- (PHImageRequestID)requestImageForAsset:(PHAsset *)asset targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(nullable PHImageRequestOptions *)options resultHandler:(void (^)(NSImage *_Nullable result, NSDictionary *_Nullable info))resultHandler;
                                                                                          ^
2 warnings and 8 errors generated.
@CaiJingLong
Copy link
Member

Because #478
You can try to use version 1.1.3 first.
I will fix it.

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