#How to Resolve "Unable to Load Project Workspace" iOS Errors

4 messages · Page 1 of 1 (latest)

icy drum
#

I've been trying to run npm run tauri ios dev --force-ip-prompt as mentioned in the documentation. However, I keep getting this error:

2025-02-04 21:46:32.321 xcodebuild[15442:293843] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 268. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.

2025-02-04 21:46:32.322 xcodebuild[15442:293843] Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0., NSJSONSerializationErrorIndex=0}

2025-02-04 21:46:32.322 xcodebuild[15442:293843] Writing error result bundle to /var/folders/w6/bd07dfn140zbfyj_3ykfvhfc0000gn/T/ResultBundle_2025-04-02_21-46-0032.xcresult

xcodebuild: error: Unable to load workspace '/Users/<USER>/repos/<APP_NAME>/src-tauri/gen/apple/<APP_NAME>.xcodeproj/project.xcworkspace/'.
        Reason: The project ‘<APP_NAME>’ is damaged and cannot be opened due to a parse error. Examine the project file for invalid edits or unresolved source control conflicts.

Is there anything that I can do to resolve this? Just as a heads up, I did the following in order to make it this far:

  1. Follow advice to update where xcode points
  2. Follow advice for adding a certificate for local iOS development

I'm hoping/assuming those actions didn't break anything. For additional context, here's line 268 of project.pbxproj:

DEVELOPMENT_TEAM = **** ****;

I tried surrounding **** **** with quotation marks ("), but Tauri automatically removes them whenever I run npm run tauri ios dev. Not sure if that's the fix anyway.

icy drum
#

Still no clarity on what the cause of the issue is here. Any insights?

What I do know is that there are only 3 lines in the xcodeproj file that mention the Development Team. 2 of these lines are DEVELOPMENT_TEAM declarations. When I remove line 268, the DEVELOPMENT_TEAM value which appears later in the file causes a parsing error. When I remove both of these lines, I don't get any parsing errors. The first instance of Development Team appears in a DevelopmentTeam declaration (notice the casing). This one doesn't seem to cause any parsing errors at any moment.

However, if I remove the 2 instances of DEVELOPMENT_TEAM, I get other build errors during tauri ios dev because I guess those values are needed to run the app locally on my iOS device.


Another interesting observation:

# In `PROJECT/src-tauri` directory
rm -rf gen/apple
npm run tauri ios init

produces the following in the xcodeproj file

DevelopmentTeam = "**** ****";
...
DEVELOPMENT_TEAM = "**** ****";

However,

# Immediately after running the aforementioned commands
npm run tauri ios dev

produces

DevelopmentTeam = "**** ****";
...
DEVELOPMENT_TEAM = **** ****;

during build time, before the app actually gets to start. After this happens, the parsing error occurs and the app crashes instead of starting. Maybe a bug? Is this something to track in GitHub?

icy drum
#

Update: This is a non-issue now. Will provide updates with what I mean soon to try to get a deeper understanding.

icy drum
#

Okay yep. This is a non-issue. An explanation of what happened:

Running npm run tauri info will give you a list of Developer Teams that you can use for iOS development. These Developer Team entries will include a name and an ID string that looks like (ID: **********). You need to use the ID, not the raw string/name of your Developer Team.

The odd thing is that I tried using the ID previously, but that failed. (This was after running into some other failures and trying to mangle the bundle.iOS.developmentTeam config without reinitializing the iOS project in Tauri.) So I thought that was the wrong approach. However, after all of my head banging, I eventually just ran

rm -rf gen/apple
npm run tauri ios init

as you could probably tell from above. Performing these steps AFTER properly changing bundle.iOS.developmentTeam to the team ID in tauri.conf.json resolved my problems. I was able to properly run npm run tauri ios dev after that.

You might still run into some errors after that, so some notes:

  1. After the app runs for the first time, you might get a notification about moving apps around on your home screen. It isn't important.

  2. If you run the app for the first time, it might not be trusted. You need to update your settings so that your Development Team is trusted.

  3. Your iPhone needs to be connected to your MacBook. (Yes, you need to do this even though XCode itself can connect with your phone via the wifi network.)

  4. Your locally-developed Tauri app needs permission to be able to access devices on the local network from your iPhone. (Yes, you need this even though your iPhone is physically connected to your MacBook.)

  5. Be ready to click Allow A LOT when you're asked about code signing and using your Developer Team ID. See Apple Info if you're considering Always Allow.