ospfranco / sol

MacOS launcher & command palette
MIT License
1.94k stars 91 forks source link

Package.resolved file is corrupted or malformed; fix or delete the file to continue: unsupported schema version 2 #4

Closed Angelk90 closed 2 years ago

Angelk90 commented 2 years ago

Hi @ospfranco , I am getting the following error when I open the sol.xcworkspace file.

Schermata 2022-03-19 alle 09 48 52

When I try to run the yarn mac command I get the following error.

yarn run v1.22.4
$ react-native run-macos
info Found Xcode workspace "sol.xcworkspace"
info Building (using "xcodebuild -workspace sol.xcworkspace -configuration Debug -scheme sol-macOS")
.....
error Failed to build macOS project. We ran "xcodebuild" command but it exited with error code 74. To debug build logs further, consider building your app with Xcode.app, by opening sol.xcworkspace.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace sol.xcworkspace -configuration Debug -scheme sol-macOS

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Resolve Package Graph
Package.resolved file is corrupted or malformed; fix or delete the file to continue: unsupported schema version 2
Resolved source packages:
  HotKey: https://github.com/soffes/HotKey @ master

xcodebuild: error: Could not resolve package dependencies:
  Package.resolved file is corrupted or malformed; fix or delete the file to continue: unsupported schema version 2

info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ospfranco commented 2 years ago

probably something wrong with the Xcode version? I'm using the latest Xcode version 13.3

Angelk90 commented 2 years ago

@ospfranco : I use 13.2.1.

ospfranco commented 2 years ago

Can't downgrade due to work, so you might updating

Angelk90 commented 2 years ago

@ospfranco : After updating xCode and several attempts I was able to get it to work.

I had to remove Apple Development, wouldn't it be better to remove it?

If not add in the documentation remember to remove it.

diff --git a/macos/sol.xcodeproj/project.pbxproj b/macos/sol.xcodeproj/project.pbxproj
index 6576358..1ec0aaa 100644
--- a/macos/sol.xcodeproj/project.pbxproj
+++ b/macos/sol.xcodeproj/project.pbxproj
@@ -374,11 +374,11 @@
                                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
                                CLANG_ENABLE_MODULES = YES;
                                CODE_SIGN_ENTITLEMENTS = "sol-macOS/sol-macOS.entitlements";
-                               CODE_SIGN_IDENTITY = "Apple Development";
+                               CODE_SIGN_IDENTITY = "-";
                                "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
                                CURRENT_PROJECT_VERSION = 1;
                                DEAD_CODE_STRIPPING = NO;
-                               DEVELOPMENT_TEAM = 24CMR7378R;
+                               DEVELOPMENT_TEAM = "";
                                ENABLE_HARDENED_RUNTIME = YES;
                                INFOPLIST_FILE = "sol-macos/Info.plist";
                                LD_RUNPATH_SEARCH_PATHS = (
@@ -407,10 +407,10 @@
                                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
                                CLANG_ENABLE_MODULES = YES;
                                CODE_SIGN_ENTITLEMENTS = "sol-macOS/sol-macOS.entitlements";
-                               CODE_SIGN_IDENTITY = "Apple Development";
+                               CODE_SIGN_IDENTITY = "-";
                                CURRENT_PROJECT_VERSION = 1;
                                DEAD_CODE_STRIPPING = NO;
-                               DEVELOPMENT_TEAM = 24CMR7378R;
+                               DEVELOPMENT_TEAM = "";
                                ENABLE_HARDENED_RUNTIME = YES;
                                INFOPLIST_FILE = "sol-macos/Info.plist";
                                LD_RUNPATH_SEARCH_PATHS = (
@@ -463,7 +463,7 @@
                                COPY_PHASE_STRIP = NO;
                                ENABLE_STRICT_OBJC_MSGSEND = YES;
                                ENABLE_TESTABILITY = YES;
-                               "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
+                               "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386";
                                GCC_C_LANGUAGE_STANDARD = gnu99;
                                GCC_DYNAMIC_NO_PIC = NO;
                                GCC_NO_COMMON_BLOCKS = YES;
@@ -526,7 +526,7 @@
                                COPY_PHASE_STRIP = YES;
                                ENABLE_NS_ASSERTIONS = NO;
                                ENABLE_STRICT_OBJC_MSGSEND = YES;
-                               "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
+                               "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386";
                                GCC_C_LANGUAGE_STANDARD = gnu99;
                                GCC_NO_COMMON_BLOCKS = YES;
                                GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
ospfranco commented 2 years ago

Xcode settings are a finicky thing, I need the certificate in there to build release versions of the app, so I will probably not remove it. The question is how do other open source projects handle this setting.

Angelk90 commented 2 years ago

@ospfranco : with latest version with added of LaunchAtLogin it seems you get the following error when running.

error Failed to build macOS project. We ran "xcodebuild" command but it exited with error code 74. To debug build logs further, consider building your app with Xcode.app, by opening sol.xcworkspace.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace sol.xcworkspace -configuration Debug -scheme sol-macOS

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Resolve Package Graph

Updating from https://github.com/soffes/HotKey

Fetching from git@github.com:sindresorhus/LaunchAtLogin.git

Failed to clone repository git@github.com:sindresorhus/LaunchAtLogin.git:
    Cloning into bare repository '/Users/User/Library/Developer/Xcode/DerivedData/sol-pokkfnbraecwzjfxzemkkrpqormeeg/SourcePackages/repositories/LaunchAtLogin-95557269'...
    git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.
Resolved source packages:
  HotKey: https://github.com/soffes/HotKey @ master

Skipping cache due to an error: Failed to clone repository git@github.com:sindresorhus/LaunchAtLogin.git:
    Cloning into bare repository '/Users/User/Library/Caches/org.swift.swiftpm/repositories/LaunchAtLogin-95557269'...
    git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.

2022-03-23 10:46:52.971 xcodebuild[1139:17093] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-03-23 10:46:52.972 xcodebuild[1139:17093] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
xcodebuild: error: Could not resolve package dependencies:
  Failed to clone repository git@github.com:sindresorhus/LaunchAtLogin.git:
    Cloning into bare repository '/Users/User/Library/Developer/Xcode/DerivedData/sol-pokkfnbraecwzjfxzemkkrpqormeeg/SourcePackages/repositories/LaunchAtLogin-95557269'...
    git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.
ospfranco commented 2 years ago

the LaunchAtLogin dependency requires ssh setup, you need to configure your XCode to hold your github credentials

Angelk90 commented 2 years ago

@ospfranco : I have cloned latest version, i am getting the following problem.

Schermata 2022-03-29 alle 14 30 26
ospfranco commented 2 years ago

should be fixed now

Angelk90 commented 2 years ago

@ospfranco : Still errors:

Schermata 2022-03-29 alle 16 53 32

Searching:

Schermata 2022-03-29 alle 16 51 22

You could take a look at these:

Schermata 2022-03-29 alle 16 56 00 Schermata 2022-03-29 alle 16 56 16
ospfranco commented 2 years ago

you probably need to reset any caches and derived files xcode has

Angelk90 commented 2 years ago

@ospfranco : I cleared the cache, I reset the packages, I also cleared the DerivedDate folder. Same problem.

ospfranco commented 2 years ago

probably something wrong with the default command then, the I renamed the default scheme from sol-macOS to macOS, try changing it on the package.json