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

Help With Building Moped #36

Closed
AugustM opened this issue Jan 23, 2024 · 6 comments
Closed

Help With Building Moped #36

AugustM opened this issue Jan 23, 2024 · 6 comments

Comments

@AugustM
Copy link

AugustM commented Jan 23, 2024

I am fairly new to Xcode development and Swift, both. I have downloaded the Moped project and the build failed because of a dependency on the "Highlightr" package. Xcode says:

Missing package product 'Highlightr', please fix package resolution errors before building

and

Package.resolved file is corrupted or malformed; fix or delete the file to continue

I interpret that as I need to either install the package or remove the references to it.

For my purposes, either route would be acceptable; I don't need syntax highlighting but I don't mind it being there.

Could someone who is familiar with the Moped code give me some direction in resolving this error? Thanks.

@AugustM AugustM changed the title Help WIth Building Moped Help With Building Moped Jan 23, 2024
@RobertoMachorro
Copy link
Owner

Which version of Xcode are you using?
How did you get the source code for Moped? (clone, zip, etc)

Moped uses Swift Package Manager for dependencies. That means all dependencies are automatically downloaded upon opening the project and should be included with the build.

@AugustM
Copy link
Author

AugustM commented Jan 31, 2024

Thanks.

I'm using Xcode 11.3.1.

I used the "Download Zip" menu option under the big, green Code button in the Code tab of this GitHub project. It downloaded as Moped-master.zip and unzipped as the Moped-master directory.

I copied that directory as Moped-local-v00. When I open the Moped.xcodeproj file in Xcode and build it, I get these two errors:

image

The file Package.resolved does not exist in the workspace. Maybe it's in an Xcode library or something?

I can't tell whether it would be easier to try to remove the feature or to fix it, and haven't had much success googling for it other than forum comments that assume I know what they are talking about or that I know how the code works, or both. I've never built an Xcode project that had package dependencies (that I know of by having to deal with it), so that's new territory for me.

@RobertoMachorro
Copy link
Owner

Please make sure you are running the latest Xcode (at the time of this message v15.2). Then follow along this video:

Building.Moped.mp4

@AugustM
Copy link
Author

AugustM commented Feb 4, 2024

Thanks for the video, but it doesn't really help to know that I could build this little app if I had the latest hardware. The latest version of Xcode that I can run is 12.4, from January 2021, just 3 years ago. I understand that that version is too old to create apps that can be distributed through the App Store, but that is not my purpose.

When I attempt to build the latest version of Moped, version 1.8.6, build 21, downloaded tonight, I get the following errors:

image

With some searching on Stack Overflow, I have found out that the package.resolved file is the culprit. The older version of Xcode does not correctly interpret the schema used by the latest versions and that prevents Xcode from knowing whether or not the highlightr package is actually there or not.

The Accepted Answer in the thread https://stackoverflow.com/questions/67185817/package-resolved-file-is-corrupted-or-malformed walked me through the steps to remove package.resolved from inside the Moped.xcodeproj file and in Xcode do File > Swift Packages > Reset Package Caches.

With that done, I was able to successfully build Moped.

I was a little disappointed that you marked this issue as "Completed" when what you essentially said was, "Use the latest version of Xcode. Here's a video that demos that the latest version works." That was not really an answer to my question. However, I did not include my Xcode version limitations in the original question, and that turns out to have the core of the obstacle. And as is all too often the case, I focussed the original question in a spurious direction, asking about installing or removing the package, when it was the incompatible package database that was the problem.

Issue Complete. Thanks.

@RobertoMachorro
Copy link
Owner

@AugustM follow up to your last comment:

My apologies, I was not aware you couldn't upgrade to a newer Xcode. Unfortunately, for a team of 1, and as a passion project, it would quickly get overwhelming to support older environments - even older than what Apple itself currently supports. I'm glad you got Moped running, your experience and work will serve as a reference to others that have an older environment, thank you.

@AugustM
Copy link
Author

AugustM commented Feb 8, 2024

I completely sympathize. I'm using this on a "passion project" of my own. I wanted to be able to rebuild Moped so that I could, at minimum, change the name of the app and, hopefully, trim down the UI a bit to eliminated irrelevant features.

It's the smallest Text Editor that I have found that has the key feature of reopening windows in their original Mission Control Desktop after a reboot. I am placing a small window with a single line of text in the bottom left corner of each Desktop to name the desktop, which I (and many other people) have found much more useful than Mission Control's numbering. Personally, I can keep about five desktops in my head, but by naming them with full text names, I can keep track of dozens. I currently have 45 desktops available and have names for 31 of them, with the other 14 unused for now, but available. I just open the window with the desired name, and since it's already open on another desktop, Mission Control takes me to that desktop instantly.

The latest version of Keyboard Maestro has a new Trigger, Space Changed, which will trigger a KBM macro when the Mission Control Desktop Space changes. The triggered macro adds the name of the newly current desktop to a pushdown stack, which allows me to have a hotkey that will perform the hugely useful task of going back to the previous desktop, without having to know it's name or number.

Being able to build a copy of Moped with a different name (DeskSpaceID) and icon means I won't have my DeskSpaceID windows mixed in with actual Moped text editing windows, it will be a separate app with its own open files list, with a name that reflects its function.

As I said, it's a "passion project" and I love to talk about it because I find it so useful personally.

Again, thanks for your help and for a useful app.

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

2 participants