Search Unity

"The Application Cannot Be Opened"

Discussion in 'macOS' started by omard2000, May 14, 2016.

  1. omard2000

    omard2000

    Joined:
    Apr 11, 2016
    Posts:
    4
    Hello Everyone,

    I'm trying to create a Mac build through a Windows machine, every time I make the build and open it up on my Mac it throws the error "Application Name cannot be opened".

    Can you please guide me through the steps on how to properly make a build for a Mac machine using a Windows machine?

    Cheers!
     
  2. omard2000

    omard2000

    Joined:
    Apr 11, 2016
    Posts:
    4
    Any ideas anyone?
     
  3. Nabren

    Nabren

    Joined:
    Mar 7, 2014
    Posts:
    61
    You might need to right click (or ctrl-click) and then select "Open" to get around Mac security settings. Unless you code sign your application you may need to also disable Gatekeeper by setting System Preferences -> Security & Privacy -> Allow apps downloaded from "Anywhere"

    I highly recommend turning that back on after you start your application if you do end up needing to allow apps downloaded from "Anywhere"
     
    Last edited: May 23, 2016
  4. omard2000

    omard2000

    Joined:
    Apr 11, 2016
    Posts:
    4
    Thanks for your reply, that didn't really work for me. Thanks for the reply though.
     
  5. Nabren

    Nabren

    Joined:
    Mar 7, 2014
    Posts:
    61
    Another thing to check is that the executable flag is set on the process for the .app.

    Check inside <app name>.app/Contents/MacOS/<executable name> with ls -al <app name>.app/Contents/MacOS/<executable name>

    Or just run chmod on the parent directory or file itself (won't hurt if it's already set)

    chmod -R +x <app name>.app/Contents/MacOS
     
    ghostitos, caiotoon, cficara and 6 others like this.
  6. sirnameless

    sirnameless

    Joined:
    May 15, 2014
    Posts:
    8
    When you build a Mac app on Windows it exports what looks like a folder. That folder is the app. Ensure you are sending over the entire folder and not what's inside the folder.

    Also if it was a Security thing you would get a specific message for that (which you probably will).
     
    Ebo77 likes this.
  7. RabidRabbit33

    RabidRabbit33

    Joined:
    Jan 14, 2017
    Posts:
    1
    Ebo77 likes this.
  8. Ebo77

    Ebo77

    Joined:
    Apr 27, 2017
    Posts:
    1
    thanks for the link
     
  9. OtisMiller

    OtisMiller

    Joined:
    Aug 17, 2015
    Posts:
    1
    Hi. I have the same problem. I'm building from a Mac to another Mac, and I get the same error message. I've fixed permissions for everything and I can't find a single thing online.
     
  10. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    Anyone get a fix for this? I have suddenly started getting this problem with a new app created in Unity 2017 on windows - an old app worked fine and still works so I don't get it, but this does not work when copied to mac

    Edit: Ok so I had a weird problem. I had an updater and if I download through the updater the first time it would not run it. If I first copied the app and then later updated it, it was ok. Basically when downloaded the app was not being trusted or something but if overwriting an existing app was ok
     
    Last edited: Mar 21, 2018
  11. domdev

    domdev

    Joined:
    Feb 2, 2015
    Posts:
    375
    I know its old but it was happening in my app now..using unity 2018.2.2f1.. any solution?
     
  12. Nabren

    Nabren

    Joined:
    Mar 7, 2014
    Posts:
    61
    Assuming you have already tried the other suggestions in this thread? The only other thing I would think to check off the top of my head is code signing.

    codesign -vvvv your_app.app
     
  13. BlueBananaProductions

    BlueBananaProductions

    Joined:
    Sep 16, 2019
    Posts:
    21
    This worked for me. Codesigning might essentially do this for you, I don't know. I suspect a Linux build could give you the same problem.
     
    abdkha and unity_QTO8h3gmy12AdA like this.
  14. BlueBananaProductions

    BlueBananaProductions

    Joined:
    Sep 16, 2019
    Posts:
    21
    Or you can do this:

    chmod -R 777 <app name>.app
     
  15. giggioz

    giggioz

    Joined:
    May 11, 2017
    Posts:
    52
  16. piginhat

    piginhat

    Joined:
    Feb 17, 2016
    Posts:
    96
    I've only just come across this problem today and found this link

    https://gist.github.com/dpid/270bdb6c1011fe07211edf431b2d0fe4

    Seems like another step towards just not making it worthwhile programming anymore, yet another hoop to try to jump through.

    Giving my apps away free and then telling end users to open terminal etc etc I can see they wont...so that's the end of me building to MacOS
     
  17. giggioz

    giggioz

    Joined:
    May 11, 2017
    Posts:
    52
    As far as I understand it's the developer that has to do all these steps, not the end user.
     
  18. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    Ok thanks & agreed,

    but has Unity said nothing on this subject? I feel like this is a big deal and it should be easier than searching for some posted steps and Unity could make it easier.
    Is this similar to what a normal Mac dev does and where are those instructions?

    Note there are 2 issues though - 1. Security if Mac does not allow uncertified apps, 2. If app copied from windows you have file attribute problems often

    @andrews_unity ?
    @nickrapp
     
    Last edited: Apr 8, 2020
  19. andrews_unity

    andrews_unity

    Unity Technologies

    Joined:
    Dec 11, 2015
    Posts:
    264

    So to be clear it is up to the dev to follow the proper notarization setups, as it does require information and apple accounts specific the dev etc... So this is something really the devs need to do.

    As for the windows attribute issue there is not much we can do there sadly as windows doesn't honor certain attributes properly.

    As for the first issue around security, this is something that is global to any application that is not signed properly or notarized for macOS 10.15 its not something specific to unity. So unless the application is signed/notarized then you will have to explicitly open it as mentioned in this thread.
     
    andyz likes this.
  20. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    Thanks, I think building for Mac in windows is a bit of an issue with Unity for these and other oddities like selecting a folder to build to and then finding it adding a .app folder/'app' next to it on finishing!
    Certification is... what is it then!
     
  21. BlueBananaProductions

    BlueBananaProductions

    Joined:
    Sep 16, 2019
    Posts:
    21
    Yeah, I experienced the issue during development while trying to deploy a test build to Mac (which was created on Windows). But when you publish a Mac build on Steam, for example, this is not relevant to the end user because their computer has already "trusted" Steam. This means when they download the application it will be installed on Steam paths with executable permissions and there will be no launch issues.
     
    Salvador-Romero likes this.
  22. unity_QTO8h3gmy12AdA

    unity_QTO8h3gmy12AdA

    Joined:
    Feb 8, 2020
    Posts:
    1
    THANKS!!! Worked fine!
     
    BlueBananaProductions likes this.
  23. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    159
    I found another thing: the default zip extractor is worse on Catalina, I don't know what it does but it does not allow the app to be executed if extracted with the default system zip management. By extracting a zip file with a 3rd party application like The Unarchiver (free on the Mac App Store) or Keka (paid) etc, it should run fine.

    - Build the Mac app on Windows or Linux, wherever, and zip it to share on the Internet
    - Those who download, do not double click it: right click and extract using a 3rd party extractor like The Unarchiver or Keka
    - Double click the extracted app, Mac will show a message saying that it is not allowed to run
    - Go to system security settings, unlock it and click to open it
    - Now it should work!

    This sucks, it is the way Apple works, they hate indie developers... Making it harder each time to run apps that do not pay them that $100 per year. Someday in the future probably they will completely block the loading, like they already do on iOS.

    By the way on Catalina it still works like this. Hope that it helps!
     
    Last edited: Aug 7, 2020
  24. rgsdev83

    rgsdev83

    Joined:
    Sep 14, 2019
    Posts:
    1
    Worked for me on a virtual machine with VirtualBox and MacOS Catalina.
     
  25. biletubes

    biletubes

    Joined:
    Feb 13, 2017
    Posts:
    6
    I had this problem when sharing a Unity app with a friend using OS X 10.15.6 (Catalina) via dropbox. Both the following steps were needed before he could open it without the 'application can't be opened' message:
    1. Change the permissions of the executable file as others mentioned above
    2. Specifically allow the app in System Preferences > Security & Privacy > General > Allow "...<app name>"
     
  26. flintcheeze

    flintcheeze

    Joined:
    Sep 10, 2015
    Posts:
    80
    Thanks man,
    Thanks man grateful
     
  27. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    So is there no way of fixing this issue using a Windows PC? I don't have access to Linux or Mac so I can't change the permissions using the methods described above.
     
  28. ETGgames

    ETGgames

    Joined:
    Jul 10, 2015
    Posts:
    101
    I got it to work by building as an XCode project, clicking archive in xcode, then distribute app with developer ID. Xcode takes care of all the signing so you don't need to do any terminal nonesense.
     
    Marcos-Elias and AlterMannn like this.
  29. Rim32

    Rim32

    Joined:
    Sep 16, 2022
    Posts:
    3
    Thanks, this worked for me ;)
     
  30. AlterMannn

    AlterMannn

    Joined:
    Sep 1, 2018
    Posts:
    8
    Thank you, this looks like only way to handle this problem. All other solutions are for running application only for the developer's mac. If you want to create .dmg file from windows build, export xcode project and archive it on xcode.
     
    Marcos-Elias and ETGgames like this.