Issue with Mac Build Post Process

Report bugs here
yzp
Posts: 2
Joined: Thu Jul 09, 2020 5:32 pm

Issue with Mac Build Post Process

Post by yzp »

I had issues with the mac OS build. I had an empty project, followed the guide on the website to configure the Hovel House Build Asset Settings, and then I tried to make a mac OS build. However, there were errors in the console about the Process.Start() in BuildProcess.cs.
  • The native errors indicated "can not find the file". I figured out that the path of the resign.sh directs to the Package folder, but the package in my project is actually inside Asset folder ( Asset downloaded and imported from the Asset Store should be there).
  • After changing the path, I resolved the first issue, but there was another issue about Process.Start(). The native error was "Access Denied". And the build was failed
  • I can run development build for iOS on the XCode. Though there are some crash issues.
I just bought the asset today and did not have enough time to resolve all those issues yet.

Besides, is mac os build with XCode supported on 2019.4? I had a plan to upgrade the project to 2019, if the XCode signing for mac OS is supported, it well be much more convenient.

Thanks

admin
Site Admin
Posts: 24
Joined: Thu Mar 19, 2020 8:52 pm

Re: Issue with Mac Build Post Process

Post by admin »

Hi there, sorry for the late reply. I had the forums misconfigured and did not receive a notification about your post. I'm very sorry that you had to wait a week for the reply

There is an issue with how the plugin was packaged as an asset-store asset. The plugin will not install correctly from the asset store, and needs to be installed from the Unity Package Manager. Unity is encouraging a move to the package manager for new plugins, but the asset store doesn't yet support an easy-install for this new format. Very sorry about that I'll work on getting an update out that addresses the install procedure.

In the meantime, you can fix this by dragging the folder out of the project. Then, in Unity, going to Window->Package Manager. In the package manager window, hit the "+" button and select "add package from disk". Navigate to the package.json file and select it. This will add it to the package manager window where you will then be given the option to install it.

Again, very sorry. I will work on getting this fixed as soon as possible.

welltold
Posts: 8
Joined: Tue Jul 14, 2020 10:35 pm

Re: Issue with Mac Build Post Process

Post by welltold »

Okay, thanks for the reply! This is really helpful because the plugin isn't currently working on OSX. But also, is there a way to just get a regular version of this bundle file? We will most likely need to edit the info.plist to make it unique since the ASC will complain about the bundleid already being in use when we try to submit the app.

Thanks again for your help!
-Andrew

admin
Site Admin
Posts: 24
Joined: Thu Mar 19, 2020 8:52 pm

Re: Issue with Mac Build Post Process

Post by admin »

The bundle for MacOS is actually just a renamed dylib file. There isn't a plist in it. So I don't think that you'll run into any issues with ASC. If you are interested I can provide you with access to the source project. Please also feel free to post any relevant logs from Unity, or the MacOS build. I may be able to help you out there.

welltold
Posts: 8
Joined: Tue Jul 14, 2020 10:35 pm

Re: Issue with Mac Build Post Process

Post by welltold »

Okay, thanks for the reply! I will report back if moving it to the Packages folder worked. Also, yes if I could be provided with the source code version of the plugin that would be most appreciated.

Thanks again!

welltold
Posts: 8
Joined: Tue Jul 14, 2020 10:35 pm

Re: Issue with Mac Build Post Process

Post by welltold »

Hmm, yeah I am still having some issues getting it to work on OSX. We also already have a custom build process so can't use the one that comes with the plugin. Having access to the source code would be great if possible! Thanks again!

admin
Site Admin
Posts: 24
Joined: Thu Mar 19, 2020 8:52 pm

Re: Issue with Mac Build Post Process

Post by admin »

I'll get you set up with source access shortly.

Setting up the MacOS version is a bit involved. If you haven't seen it already you may want to check out the MacOS build guide. http://www.hovelhouse.com/building_for_macos.html

Are you building a MacOS build as a standalone app? Or using the newer (and sorta broken) Xcode project support that comes with unity?

The most likely thing that will trip you up here is code-signing. Without x-code, the only way to code sign an app is via the command line. This involves opening the application and signing each library separately. There's a shell script that the plugin builder runs that does this. If you use your own build process, you may need to include this step before the app is launchable.

welltold
Posts: 8
Joined: Tue Jul 14, 2020 10:35 pm

Re: Issue with Mac Build Post Process

Post by welltold »

Oh, sorry for the double reply. Hard to tell if my reply goes through since it requires approval first. Yes, we are just building out a standalone app and manually signing the plugins we are using via the codesign tool apple provides which has worked so far with the .bundle plugin files we use currently and the .dylibs unity provides. I will look into how you have set up signing to see if something we are doing might be causing issues.

Also, here is the command we are using to sign bundles currently:

Code: Select all

codesign -o runtime -f --verify --deep -s "$SIGN_CERT" --preserve-metadata=identifier,entitlements,flags "$APP_NAME".app/Contents/Plugins/HHCloudKitMacOS.bundle
We are also using Unity 2018.4.24 if that makes a difference.

Thanks again,
Andrew

admin
Site Admin
Posts: 24
Joined: Thu Mar 19, 2020 8:52 pm

Re: Issue with Mac Build Post Process

Post by admin »

Hi Andrew, are you still having issues with the MacOS build?

I took today to review the postprocess build scripts for MacOS and found some issues:
Firstly, it looks as if the resign.sh script is not set to executable, and results in a permission denied error when the editor attempts to run it. I had to chmod +x the file before I could use it. The file was sumbitted to the asset store with the appropriate permissions, something about the import process may have changed them. I will look into it further.

Secondly, the MacOS build process is not paying attention to the "Add Default Containers" checkbox, and generates an entitlements file without any container identifiers in it. Signing the app without a container identifier will cause it to crash on startup with a code signing error.

adding this code snippet to the buildprocess.cs file around line 125 should fix the second issue

Code: Select all

var cloudContainers = appEntitlements.root.CreateArray(ContainersEntitlement);
cloudContainers.AddRangeIfMissing(settings.CustomContainers);

/// New Code starts Here
if (settings.AddDefaultContainers)
{
    cloudContainers.AddIfMissing($"iCloud.{PlayerSettings.applicationIdentifier}");
}
/// New code ends here
I will update the docs on the website with this information today.

Alternatively, you could disable the checkbox for adding the default container and specify it manually in the custom containers list. The default container is of the form: "iCloud.{your-bundle-identifier}"

You mentioned that you are using your own post-process build script, so the above information may not be of much relevance, but I thought I would mention what I dug up. That being said, I would like to be able to narrow down the cause of you issue, but need some more information.

Firstly, Right now I'm assuming your issue is a code-signing one, but that's just an educated guess. I would like to verify that's what the cause is. When you launch the app what happens? Does it crash immediately? Or take you to the example hub? When it does crash, could you provide me with the report from the system dialogue?

Secondly, if you feel comfortable sharing it, I would like to take a look at your signing script and check your entitlements file.

As for the XCode project support you enquired about earlier. You are welcome to use a Unity generated xcode project. My only difficulty there was that unity's xcode support for MacOS seems to have been half-implemented. The PBXProject API was not working with the generated project, and I was unable to use it to modify the project settings. Theoretically, there is nothing about the plugin that would prevent it from working in the MacOS xcode project, but you would need to modify the entitlements and build settings by hand.

welltold
Posts: 8
Joined: Tue Jul 14, 2020 10:35 pm

Re: Issue with Mac Build Post Process

Post by welltold »

Thanks again for your reply. Actually I think the main issue we are having is that the plugin itself is not being loaded in the code as that is the error we get in builds. We are also using another gamecenter plugin that is signed the same way and it is working fine in the build. So i think I just wasn't sure if the process of signing this bundle was any difference since in the past we have only used actual bundle files that have plists etc. Like does renaming the dylib to a bundle file a part of the process to make Unity recognize it? And is it okay if its in the Plugins folder and not the Frameworks folder in a build with the other dylib files.

As a note, I don't believe we have the build to Xcode Project because our project is built in Unity 2018.4.24. Do you think it should still work in an older versions of Unity prior to Unity 2019?

Thanks again for your help,
Andrew

Post Reply