sweetpad-dev / sweetpad

Develop Swift/iOS projects using VSCode
https://marketplace.visualstudio.com/items?itemName=sweetpad.sweetpad
MIT License
195 stars 7 forks source link

Build & Run (Launch) failing #38

Closed schwjustin closed 2 days ago

schwjustin commented 1 week ago

When I try to build and run I get this error: Sweetpad: Cannot read properties of undefined (reading 'startsWith')

...
\n      \"XCODE_VERSION_MAJOR\" : \"1500\",\n      \"XCODE_VERSION_MINOR\" : \"1520\",\n      \"XPCSERVICES_FOLDER_PATH\" : \"Test.app/XPCServices\",\n      \"YACC\" : \"yacc\"\n    },\n    \"target\" : \"Test\"\n  }\n]",
  "stderr": "2024-09-10 19:00:32.552 xcodebuild[59969:5122444] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition",
  "command": "xcodebuild",
  "args": [
    "-showBuildSettings",
    "-scheme",
    "Test",
    "-workspace",
    "/Users/justinschwartz/Developer/Test/test/Test.xcodeproj/project.xcworkspace",
    "-configuration",
    "Debug",
    "-json"
  ],
  "cwd": "/Users/justinschwartz/Developer/Test/test"
}
{
  "message": "Cannot read properties of undefined (reading 'startsWith')",
  "level": 3,
  "time": "2024-09-10T23:00:32.881Z",
  "command": "sweetpad.build.launch",
  "error": {}
}

Screenshot 2024-09-10 at 6 59 49 PM

hyzyla commented 6 days ago

Hello! Thank you for reporting issue!

Unfortunately, the error message in the logs is quite unclear about where it happened. Could you manually run this command in your project directory and send me the output you get?

cd /Users/justinschwartz/Developer/Test/test
xcodebuild -showBuildSettings -scheme Test -workspace /Users/justinschwartz/Developer/Test/test/Test.xcodeproj/project.xcworkspace -configuration Debug -json
schwjustin commented 5 days ago

@hyzyla thanks for getting back to me on this

2024-09-12 17:49:07.350 xcodebuild[87902:6723838] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition
[
  {
    "action" : "build",
    "buildSettings" : {
      "__IS_NOT_MACOS" : "YES",
      "__IS_NOT_MACOS_macosx" : "NO",
      "__IS_NOT_SIMULATOR" : "YES",
      "__IS_NOT_SIMULATOR_simulator" : "NO",
      "_WRAPPER_CONTENTS_DIR_SHALLOW_BUNDLE_NO" : "/Contents",
      "_WRAPPER_PARENT_PATH_SHALLOW_BUNDLE_NO" : "/..",
      "_WRAPPER_RESOURCES_DIR_SHALLOW_BUNDLE_NO" : "/Resources",
      "ACTION" : "build",
      "AD_HOC_CODE_SIGNING_ALLOWED" : "NO",
      "AGGREGATE_TRACKED_DOMAINS" : "YES",
      "ALLOW_TARGET_PLATFORM_SPECIALIZATION" : "NO",
      "ALTERNATE_GROUP" : "staff",
      "ALTERNATE_MODE" : "u+w,go-w,a+rX",
      "ALTERNATE_OWNER" : "justinschwartz",
      "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES" : "NO",
      "ALWAYS_SEARCH_USER_PATHS" : "NO",
      "ALWAYS_USE_SEPARATE_HEADERMAPS" : "NO",
      "APP_SHORTCUTS_ENABLE_FLEXIBLE_MATCHING" : "YES",
      "APPLE_INTERNAL_DEVELOPER_DIR" : "/AppleInternal/Developer",
      "APPLE_INTERNAL_DIR" : "/AppleInternal",
      "APPLE_INTERNAL_DOCUMENTATION_DIR" : "/AppleInternal/Documentation",
      "APPLE_INTERNAL_LIBRARY_DIR" : "/AppleInternal/Library",
      "APPLE_INTERNAL_TOOLS" : "/AppleInternal/Developer/Tools",
      "APPLICATION_EXTENSION_API_ONLY" : "NO",
      "APPLY_RULES_IN_COPY_FILES" : "NO",
      "APPLY_RULES_IN_COPY_HEADERS" : "NO",
      "arch" : "arm64",
      "ARCHS" : "arm64",
      "ARCHS_STANDARD" : "arm64",
      "ARCHS_STANDARD_32_64_BIT" : "armv7 arm64",
      "ARCHS_STANDARD_32_BIT" : "armv7",
      "ARCHS_STANDARD_64_BIT" : "arm64",
      "ARCHS_STANDARD_INCLUDING_64_BIT" : "arm64",
      "ARCHS_UNIVERSAL_IPHONE_OS" : "armv7 arm64",
      "ASSETCATALOG_COMPILER_APPICON_NAME" : "AppIcon",
      "ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS" : "YES",
      "ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME" : "AccentColor",
      "AUTOMATICALLY_MERGE_DEPENDENCIES" : "NO",
      "AVAILABLE_PLATFORMS" : "appletvos appletvsimulator driverkit iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator",
      "BITCODE_GENERATION_MODE" : "marker",
      "BUILD_ACTIVE_RESOURCES_ONLY" : "NO",
      "BUILD_COMPONENTS" : "headers build",
      ...

If you need the rest to help debug please let me know and I can email it or pm on something

hyzyla commented 5 days ago

Hi. You can email me hyzyla@gmail.com

schwjustin commented 5 days ago

@hyzyla sent!

shaharukhs commented 4 days ago

I am also facing the same issue with VS Code extension.

hyzyla commented 3 days ago

@schwjustin I've added better error handling in all places where I'm calling .startsWith. Also I've added sentry reporting (disabled by default). Could you update extension (0.1.30), enable sentry reporting in .vscode/settings.json and try again?:

{
    "sweetpad.system.enableSentry": true,
}
schwjustin commented 2 days ago

@hyzyla it works!