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

"flag provided but not defined: -profile" when trying to build a MacOS release application #223

Open
philiplb opened this issue Mar 4, 2024 · 8 comments

Comments

@philiplb
Copy link

philiplb commented Mar 4, 2024

Describe the bug:

I'm trying to use fyne-cross to build and package a MacOS application in the release mode. When I do so, I get the error message "flag provided but not defined: -profile".

To Reproduce:

Steps to reproduce the behaviour:

Run the command

version="1.0.0"
fyne-cross darwin -arch=arm64,amd64 -app-id=<appId> -release -profile <profileName> -name <myName> -app-version "$version"

With the app-id and the name being the same as in the profile.

Device and debug info (please complete the following information):

Device info
  • OS: MacOS
  • Version:
  • Go version: 1.22.0
  • fyne-cross version: 049e534
  • Fyne version: 2.4.4
Debug info
flag provided but not defined: -profile

Usage: fyne-cross darwin [options] [package]

Build and package a fyne application for the darwin OS

Options:
-app-build int
Build number, should be greater than 0 and incremented for each build (default 1)
-app-id string
Application ID used for distribution [required]
...

@andydotxyz
Copy link
Member

Isn't the profile parameter only needed for iOS builds?

@philiplb
Copy link
Author

philiplb commented Mar 5, 2024

It's asking for it if I don't give it:

missing required -profile parameter for macOS release
Here is the output of fyne-cross darwin -arch=arm64,amd64 -app-id=<appId> -release -name <myName> -app-version "$version" -no-cache -debug

[i] Target: darwin/arm64
&command.localContainerImage{baseContainerImage:command.baseContainerImage{arch:"arm64", os:"darwin", id:"darwin-arm64", env:map[string]string{"CC":"zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks", "CGO_LDFLAGS":"--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib", "CXX":"zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks", "GOARCH":"arm64", "GOOS":"darwin"}, tags:[]string(nil), mount:[]command.containerMountPoint{command.containerMountPoint{name:"project", localHost:"/Users/<user>/repos/<appname>/src", inContainer:"/app"}}, DockerImage:"docker.io/fyneio/fyne-cross-images:darwin"}, runner:(*command.localContainerEngine)(0x1400009e000)}
[i] Cleaning target directories...
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib -e GOOS=darwin -e GOARCH=arm64 docker.io/fyneio/fyne-cross-images:darwin rm -rf /app/fyne-cross/bin/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib -e GOOS=darwin docker.io/fyneio/fyne-cross-images:darwin mkdir -p /app/fyne-cross/bin/darwin-arm64
[✓] "bin" dir cleaned: /app/fyne-cross/bin/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib -e GOOS=darwin docker.io/fyneio/fyne-cross-images:darwin rm -rf /app/fyne-cross/dist/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOOS=darwin -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib docker.io/fyneio/fyne-cross-images:darwin mkdir -p /app/fyne-cross/dist/darwin-arm64
[✓] "dist" dir cleaned: /app/fyne-cross/dist/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOOS=darwin -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib docker.io/fyneio/fyne-cross-images:darwin rm -rf /app/fyne-cross/tmp/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib -e GOOS=darwin docker.io/fyneio/fyne-cross-images:darwin mkdir -p /app/fyne-cross/tmp/darwin-arm64
[✓] "temp" dir cleaned: /app/fyne-cross/tmp/darwin-arm64
[i] Checking for go.mod: /Users/<user>/repos/<appname>/src/go.mod
[✓] go.mod found
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOOS=darwin -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib docker.io/fyneio/fyne-cross-images:darwin cp /app/Icon.png /app/fyne-cross/tmp/darwin-arm64/Icon.png
[i] Packaging app...
fyne cli version: v2.4.3
/Users/<user>/go/bin/fyne release -os darwin -name <appname> -icon /Users/<user>/repos/<appname>/src/fyne-cross/tmp/darwin-arm64/Icon.png -appBuild 1 -appVersion 1.0.0 -appID com.<appname>
missing required -profile parameter for macOS release
[✗] could not package the Fyne app: could not package the Fyne app: exit status 1

@andydotxyz
Copy link
Member

Oh I remember now. Are you trying to ship it for the macOS store?

@philiplb
Copy link
Author

philiplb commented Mar 6, 2024

Not for the App-store, but you have to sign it when you want to execute an app being distributed in a .dmg. MacOS just says that it is damaged if it is downloaded. Rightclick and selecting "Open" doesn't work, too. If I execute the app directly after building, everything is fine.

@andydotxyz
Copy link
Member

Ah. Release mode is for the store distribution.
I guess you're referring to the notarisation issue mentioned at https://docs.fyne.io/faq/troubleshoot

@philiplb
Copy link
Author

philiplb commented Mar 6, 2024

Ah, yes, that might be :)
But as I already enrolled now in the Apple developer program and created a certificate and distribution profile, I will go through this process now: https://stackoverflow.com/questions/69354021/how-do-i-go-about-code-signing-a-macos-application
And see how it goes. Looks a bit tedious...

@Antiarchitect
Copy link

Seems kinda similar to me:

fyne-cross darwin -macosx-sdk-path ~/Downloads/SDKs/MacOSX11.3.sdk/ -arch amd64,arm64 ./cmd/seenday/
flag provided but not defined: -w"
usage: link [options] main.o

@andydotxyz
Copy link
Member

The error may seem similar but it's very different - that is an error with the compilation process, but this ticket is reporting an issue with command line parameters into Fyne-cross itself

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

3 participants