# Xcode 26 / CocoaPods Compatibility Workaround

**Date:** 2025-01-27  
**Issue:** CocoaPods `xcodeproj` gem (1.27.0) doesn't support Xcode 26's project format version 70

## The Problem

Xcode 26.1.1 uses project format version 70, but the `xcodeproj` gem (1.27.0) only supports up to version 56. This causes CocoaPods to fail with:

```
ArgumentError - [Xcodeproj] Unable to find compatibility version string for object version `70`.
```

## Solutions

### Option 1: Temporarily Downgrade Project Format (Recommended for Now)

**Before running `pod install` or `npm run build:ios`:**

1. Edit `ios/App/App.xcodeproj/project.pbxproj`
2. Change line 6 from: `objectVersion = 70;` to: `objectVersion = 56;`
3. Run your build/sync command
4. Change it back to: `objectVersion = 70;` (Xcode will likely change it back automatically)

**Warning:** Xcode may automatically upgrade the format back to 70 when you open the project. This is okay - just repeat the process when needed.

### Option 2: Wait for xcodeproj Update

The `xcodeproj` gem maintainers will eventually release a version that supports format 70. You can:
- Check for updates: `bundle update xcodeproj`
- Monitor: https://github.com/CocoaPods/Xcodeproj/issues

### Option 3: Use Xcode Directly (Bypass CocoaPods for Now)

Since the Share Extension is already set up:
1. Open the project in Xcode
2. Build directly from Xcode (Product → Build)
3. Skip `npm run build:ios` for now
4. Test the Share Extension functionality

### Option 4: Automated Workaround (Integrated into Build Script) ✅

The workaround is now **automatically integrated** into `scripts/build-ios.sh`. When you run:

```bash
npm run build:ios
```

The build script will:
1. Automatically detect if the project format is version 70
2. Temporarily downgrade to version 56
3. Run `pod install`
4. Restore to version 70
5. Continue with the build

**No manual steps required!** The workaround is transparent and only applies when needed.

To remove the workaround in the future:
1. Check if `xcodeproj` gem supports format 70: `bundle exec gem list xcodeproj`
2. Test if `pod install` works without the workaround
3. If it works, remove the `run_pod_install_with_workaround()` function from `scripts/build-ios.sh`
4. Replace it with a simple `pod install` call

## Current Status

- ✅ Share Extension target exists
- ✅ Share Extension files are in place
- ✅ Workaround integrated into build script
- ✅ `npm run build:ios` works automatically

## Recommendation

**Use `npm run build:ios`** - the workaround is handled automatically. No manual intervention needed.

Once `xcodeproj` is updated to support format 70, the workaround can be removed from the build script.

