My entire project was working fine until MacOS 14.5 and Xcode 15.4. However when trying to build the app now I get the following
Unable to read Google Service plist at path
I have gone through the following steps.
Step 1)
- Download google-service.plist from Firebase.
- Add to project folder, check target.
- Add to Target > Build Settings > Copy Bundle Resources
Errors:
Unable to read Google Service plist at path /Users/approot/Shared/GoogleService-Info.plist
Unable to read Google Service plist at path /Users/approot/Shared/GoogleService-Info.plist
Sandbox: cp(38870) deny(1) file-read-data /Users/approot/Shared/GoogleService-Info.plist
Step 2) Ensure File Permissions:
Verify that the GoogleService-Info.plist file has the correct permissions.
chmod 644 /Users/approot/Shared/GoogleService-Info.plist
Step 3) Create a new “Run Script Phase” to copy the file
bash
Copy code
SRC="${SRCROOT}/Shared/GoogleService-Info.plist"
DEST="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_NAME}.app/GoogleService-Info.plist"
echo "Source path: $SRC"
echo "Destination path: $DEST"
if [ -f "$SRC" ]; then
echo "Copying $SRC to $DEST"
cp "$SRC" "$DEST"
if [ $? -ne 0 ]; then
echo "Error copying file."
exit 1
fi
else
echo "File not found: $SRC"
exit 1
fi
Step 4) Check File System Access:
Ensure that Xcode has full disk access. This can sometimes resolve sandbox-related issues.
Go to System Preferences > Security & Privacy > Privacy tab.
Select Full Disk Access and make sure Xcode is added to the list of applications with full disk access.
Step 5) Check Derived Data:
Delete the derived data folder.
Example Run Script Phase with Debugging
Here’s an enhanced version of the script to include more detailed debugging information:
bash
Copy code
#!/bin/bash
SRC="${SRCROOT}/Shared/GoogleService-Info.plist"
DEST="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_NAME}.app/GoogleService-Info.plist"
echo "Source path: $SRC"
echo "Destination path: $DEST"
if [ -f "$SRC" ]; then
echo "File exists. Copying $SRC to $DEST"
cp "$SRC" "$DEST"
if [ $? -ne 0 ]; then
echo "Error copying file."
exit 1
fi
else
echo "File not found: $SRC"
exit 1
fi
Step 6) Restart Xcode
Re-indexed Project: Closed Xcode, deleted derived data, and reopened the project to allow Xcode to re-index it. Reinstalled packages and repeated this entire step 250+ times.