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

Warning message "developer cannot be verified" in Big Sur when including active-win #98

Open
jmtame opened this issue Feb 3, 2021 · 9 comments

Comments

@jmtame
Copy link

jmtame commented Feb 3, 2021

When I'm including active-win in our desktop Electron app, we now see a warning that Apple cannot open the app because the developer cannot be verified. Expected behavior is to allow the app to be opened. This only happens in Big Sur.

I've tried adding all entitlements (https://developer.apple.com/documentation/security/hardened_runtime), no luck. We use ToDesktop to distribute our app.

Whenever I remove active-win in the project, the error message goes away and the app opens normally as expected.

@sindresorhus
Copy link
Owner

I don't think the binary can be notarized. We would have to ship it in a ZIP file which is then notarized. However, I think if you notarize your app bundle, any binaries inside it should also be notarized. https://developer.apple.com/forums/thread/118190

@alexgurr
Copy link

alexgurr commented Mar 15, 2021

I am experiencing this as well! Even notarized I get the issue above. Tracked it down to a problem with the main file in the node module. (not sure where the main file comes from)

This is what GateKeeper logs in systems log:

File /Applications/Shootsta Project Timer2.app/Contents/Resources/app.asar.unpacked/node_modules/active-win/main failed on rPathCmd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftAppKit.dylib (rpath resolved to: (path not found), bundleURL: /Applications/Shootsta Project Timer2.app)

Could be because active-win is statically linking binaries? https://forums.swift.org/t/bundle-stdlib-with-swift-binary/43653. Not sure what the solution is.

@sambhavsharma
Copy link

I moved the active-win folder from node_modules to the app src. Basically packaged the library within my app and removed it from node dependencies.
Then you change your electron code accordingly to use the packaged library.
Next: install_name_tool -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx @executable_path/../../../swift-libs active-win/main

@spooneuh
Copy link

sambhavsharma thank you so much. The workaround you described here worked perfectly for me.

@shafayet2368
Copy link

@sambhavsharma @spooneuh ,,
Next: install_name_tool -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx @executable_path/../../../swift-libs active-win/main

could not understand this part. can you please explain this part. It would be a great help.

@shafayet2368
Copy link

@jmtame ,, Could you solve the issue? .. I am also having the same issue. Can you please help me out in this regard?

@sambhavsharma
Copy link

@sambhavsharma @spooneuh ,,
Next: install_name_tool -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx @executable_path/../../../swift-libs active-win/main

could not understand this part. can you please explain this part. It would be a great help.

You just need to run the above mentioned command. It tells xcode to use the package swift file (in this case the main file) by updating the rpath.

install_name_tool -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx @executable_path/../../../swift-libs active-win/main

^ This is one command

@shafayet2368
Copy link

install_name_tool -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx @executable_path/../../../swift-libs active-win/main

@sambhavsharma thanks for the quick reply.

if I run the above command I get the error

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: active-win/main (No such file or directory)

Do I need to run this command from a specific directory or from my home directory ?.. Your help would be great. I am stuck in this issue for quite some days.

@sambhavsharma
Copy link

install_name_tool -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx @executable_path/../../../swift-libs active-win/main

@sambhavsharma thanks for the quick reply.

if I run the above command I get the error

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: active-win/main (No such file or directory)

Do I need to run this command from a specific directory or from my home directory ?.. Your help would be great. I am stuck in this issue for quite some days.

Find your main file. It is in active-win repository/package. Read my workaround solution once again. It is pretty straightforward.

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

6 participants