xCode 11.1 crashes after opening existing projects


:crossed_fingers:

For me: NO!

Still crashes. Ugh!

The fundamental crash comes from the system trying to do something (incorrectly) with the “.hyperesources” extension.

I think if you were to modify the export to not use the .hyperesources folder you would not get the crash; my recommendation would be to try exporting using the Organized Asset export script found on this page: https://tumult.com/hype/export-scripts/

The trickier part may be that if you don’t have an earlier system or can’t temporarily fix the crash, you’ll still need to modify the .xcodeproj file to not have the reference to .hyperesources. I’d guess you could just directly edit the project.pbxproj file within the .xcodeproj folder to change any text references of .hyperesources to something like .blah, but make a backup and be careful (I haven’t tested this!)

1 Like

I have access to an older machine later tonight. I will give this a try. Thanks for the tip! Is there a suggested naming format for the new folder?

Thanks for your help Jonathan. I used the “Organized Assets” script export as suggested and I actually like the output much better! I needed to make one minor adjustment to my code to get Xcode’s Simulator working as it places my “html” file now within the resource folder. I did this from my older MacBook Air machine. Now in Xcode on the newer machine, I can run Simulator but it will not fully load the “LLD_Ver2.html” file. It’ll only load to a pink screen (background color) as opposed to the full app? Any suggestions from here? Thanks!

Xcode - New Organized Asset export and “htmlPath” change…

Simulator…

“LLD_Ver2.html” file run directly in Safari…

Never mind. I had to modify the “LLD_Ver2.html” src from “./path/filename” to “full path/filename”. First glance, it is now loading in Simulator. Thanks!!

Original output…

Modified output…

1 Like

Glad that worked!

I would instead change the baseURL you are supplying to be the LLD_Ver2 folder, as then you will not need to make any changes on re-export.

let baseUrl = URL(fileURLWithPath: htmlPath.deletingLastPathComponent, isDirectory: true)

Hello,

I think I understand what you are suggesting as changing all paths is quite exhausting. However, I’m getting an error with your suggestion. I think I’m missing something?

Oh right - sorry I’m not a swift coder and often forget that you have to deal with swift’s much more strict nil checking than in my native objective-c tongue :slight_smile:. It seems you also would have to deal with the fact that swift’s string isn’t the same as the NSString that I use, so deletingLastPathComponent doesn’t really seem to exist unless it is on a URL.

I’d probably use all URLs and an approach like:

		if let htmlURL = Bundle.main.url(forResource: "blah", withExtension: "blah") {
			let folderURL = htmlURL.deletingLastPathComponent
			
			// load stuff here
		}

but I’m not really a swift coder so you may instead want to research more on the best practices for handling nil issues and whether the standard is to use URLs or string-based paths.

1 Like

Just wanted to check in and say that I got everything working again. I just have to export any Hype updates to another location and then copy them into my project minus the two files affected by this all (“LLD_Ver2.html” & the “lldver2_hype_generated_script.js” files) (assuming they have not changed). I modified those files to the renamed export folder. FYI, I’ve renamed the exported “LLD_Ver2.hyperesources” folder to just “LLD_Ver2”. It seems that Xcode sees the “projectName(.)hyperesources” right away and crashes without warning. Whereas if you take the “.hyperesources” away in the folder name, it works just fine (as I and Jonathan were aware of). I think I can live with this (knowing that I cannot get a clean export as of now without changing my code, modifying files or changing the export script). I wonder if because of the problem with Xcode if Hype would be able to have an option to drop the “.hyperesorces” in the Advanced Export options??? Anyways, thanks for your help!

1 Like

Great - I’m glad you got it.

There’s a really long and boring technical history on how/why there’s a “.hyperesources” folder; mainly to work around Apple sandbox restrictions and also server issues. Because this is a hopefully fixable bug on Apple’s part and there are workarounds, we won’t at this time offer an option in Advanced Export. That said, I have often wanted to allow more control over the export folder through the Resources Library, but that’s a whole different feature!

Is there something specifically wrong with the Organized Asset export? The flow is basically the same as a normal export - you can even assign a shortcut in the keyboard prefs and also set it up to be used in Advanced Export.

Sorry for my delayed response. There is nothing wrong with the Organized Assets export as far as I’m concerned. I actually like the format of the output. It is much nicer. However, my Xcode project/code has trouble finding the files. I think the difference is that the Advanced export dumps everything into one folder. This makes my code very simple as I only have to reference the one asset folder. In the Organized Assets export, it creates sub folders that move files around for referencing. I’m sure there is a very logical way to resolve this but I’m not a programmer by trade (as you all have noticed by now :stuck_out_tongue_winking_eye:). So for me, moving forward, I will have to workaround it. It would be nice to remove the .hyperesource extension as Xcode has had about 3 or 4 updates since I’ve encounter the issue and have not fixed it. However, I do understand the desire not to add this ability. Hope this makes sense Jonathan! Thanks again for being so helpful!

Hmm… in the above Xcode screenshot you have the folder as “blue” which is the correct result if the adding was done as a Folder Reference. Folder references are one top-level object and should track everything inside automatically. I found in the past sometimes I needed to do a clean and rebuild if there were changes, but Xcode has seemed better about this lately. However if the folder is now showing up as “orange” you’ll just want to re-import it as a Folder Reference set on the add files open panel. (also make sure it is not copied and there’s a target set)

Catalina 10.15.2 : still not fixed. Shame on Apple!
I’m beginning to think they don’t want to fix it. It shouldn’t be that hard I guess.

That detail solved it for me, @Djon! NOT opening the awful Xcode app but instead right-clicking the project itself and selecting Xcode as the app of choice with which to open it. Thank you!.

2 Likes

Glad it works. Although nowadays I prefer to use the @MarkHunte template and the “organised assets” export script. Works very well together.

1 Like

May? It totally does. :laughing:

32%20PM

It crashes for me after running the second terminal command.

Why isn’t this the standard way Hype exports files? It looks much nicer.

Ah… because it breaks things.

<div style="width: 100%; height: 100%; background: url('${resourcesFolderName}/camouflage-640x360.svg') repeat-x; background-size: 50% 100%"></div>

That was used as innerHTML, which resulted in no background image appearing after the Organized Export.

Noooo… come on… the world needs you! :smile:

I’m posting up on this thread to follow the progress and add feedback. This is a problem for me, as I’m trying to update the “Hype-to-App” chapter for A Book About Hype. I’m not sure what would be the right way of doing a new project, but I’m experimenting tonight.

I was wondering why “Widgets” didn’t crash, but I was having trouble with other Xcode projects. At least I know that it’s related to the “.hyperesources” folder.

Heh, what, you don’t like… download[4592:3951822] [Process] kill() returned unexpected error 1 …spamming the console log?

How about blind logging into your Mac Mini, just because it can’t actually run the display on startup? HA HA — that’s after buying a new cable. It was worse with HDMI.

This looks like a mess. I might have to abandon the chapter. “Organized Assets” is not quite an ideal fix for me. I’ve been trying to write around the glaring macOS issues. HA HA. Because if Apple fixes the bug, the book has outdated information. If they don’t fix the bug, it’s just weird and confusing.

I’ll be experimenting tonight to see if this is just for existing projects, or if even new projects have this problem.


Update — It looks like this is a problem with new projects too. I’m thinking of abandoning the chapter.

This has finally been fixed with the macOS 10.13.4 beta. I can’t tell you how miserable Whisk development was because of it.

Yeah, just to reiterate - the problem is with folders added to Xcode using “.hyperesources.”

I haven’t got a notification back from Apple about the bug, but I can’t seem to currently reproduce on the 10.13.4 beta with Xcode 11.4 beta as well. So it may be fixed soon.

2 Likes

I decided to add the chapter. I also added a block of text explaining that the .hyperesources folder could crash Xcode. If Apple fixes this problem in three months, I can update the chapter.

I also added a link to the template on the @MarkHunte GitHub page.

3 Likes