Skip to content
New issue

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

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

Already on GitHub? # to your account

won't build for macOS with error #1

Closed
copypasteearth opened this issue Jul 22, 2020 · 8 comments
Closed

won't build for macOS with error #1

copypasteearth opened this issue Jul 22, 2020 · 8 comments

Comments

@copypasteearth
Copy link

Im getting this error when trying to run on macOS, some help would be appreciated

SecureBookmarksPlugin.swift:60:15: error: initializer for conditional binding must
have Optional type, not 'URL'
[        ]         guard let url = try URL(resolvingBookmarkData: bookmark, options: .withSecurityScope, bookmarkDataIsStale: &isStale) else {
[        ]               ^

@hpoul
Copy link
Collaborator

hpoul commented Jul 22, 2020

have you tried starting the example/ project? which swift version are you using?

@copypasteearth
Copy link
Author

I just downloaded the repository and ran the example and it worked, there is something messed up in my project I guess. I actually messed it up to the point that none of my plugins are compiling now so I have to wait for my issue in the flutter repository to be resolved before I figure out what the problem was with my project with this plugin. I will come back and update this thread when I figure it out.

@copypasteearth
Copy link
Author

UPDATE: I just copied the macOS folder from the example project to my projects folder and it built and worked. There is something that is preventing it from being built with the flutter create . folder that is automatically generated by flutter. maybe this plugin was built with an older version of flutter. I got it working but would really like it to work with the latest macOS folder structure

@copypasteearth
Copy link
Author

UPDATE 2: I was messing around with the plugin code and recreated the example folder so that it has the latest macOS folder and I guess the lates swift, then I put a question mark after the try? in the code in my opening post and it built and ran the same as the older version

`guard let url = try? URL(resolvingBookmarkData: bookmark, options: .withSecurityScope, bookmarkDataIsStale: &isStale) else {

@copypasteearth
Copy link
Author

#2

submitted a pull request

@hpoul
Copy link
Collaborator

hpoul commented Jul 27, 2020

Thanks for the PR, unfortunately i've already started playing around myself.. i've just pushed a commit into master 1322ce8

maybe you could give this one a try as well? then i'll release a new version to pub

@copypasteearth
Copy link
Author

nice works perfect, I just tested it

@hpoul
Copy link
Collaborator

hpoul commented Jul 28, 2020

thanks again, published as 0.1.1 🎉️

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

No branches or pull requests

2 participants