get-windows icon indicating copy to clipboard operation
get-windows copied to clipboard

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

Open jmtame opened this issue 4 years ago • 9 comments
trafficstars

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.

jmtame avatar Feb 03 '21 23:02 jmtame

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

sindresorhus avatar Feb 06 '21 09:02 sindresorhus

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.

alexgurr avatar Mar 15 '21 07:03 alexgurr

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

sambhavsharma avatar Apr 06 '21 23:04 sambhavsharma

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

spooneuh avatar Apr 13 '21 13:04 spooneuh

@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 avatar Apr 27 '21 03:04 shafayet2368

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

shafayet2368 avatar Apr 29 '21 02:04 shafayet2368

@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

sambhavsharma avatar Apr 29 '21 10:04 sambhavsharma

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.

shafayet2368 avatar May 03 '21 03:05 shafayet2368

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.

sambhavsharma avatar May 03 '21 06:05 sambhavsharma