fix(ios): resolve build errors for daily notification plugin
- Add podspec file for daily notification plugin with correct name
- Create TimesafariDailyNotificationPlugin.podspec to match Capacitor's
expected naming convention
- Podspec name must match Podfile reference for CocoaPods compatibility
- Update Podfile to reference TimesafariDailyNotificationPlugin
- Add automated fix script for podspec creation
- scripts/fix-daily-notification-podspec.sh creates podspec with correct
name before Capacitor sync
- Integrated into build-ios.sh build process
- Fix typo in package.json: change "pina" to "pinia" (^2.1.7)
Fixes:
- Vite build error: "Failed to resolve import 'pinia'"
- CocoaPods error: "No podspec found for 'TimesafariDailyNotificationPlugin'"
- CocoaPods error: "The name of the given podspec doesn't match the expected one"
The podspec file is created automatically during the build process to ensure
Capacitor sync can find the plugin with the expected name, while maintaining
compatibility with the actual podspec file name in the plugin package.
This commit is contained in:
@@ -538,6 +538,18 @@ run_cap_sync_with_workaround() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Step 6.4: Fix Daily Notification Plugin podspec name for Capacitor sync
|
||||
log_info "Fixing Daily Notification Plugin podspec name..."
|
||||
if [ -f "./scripts/fix-daily-notification-podspec.sh" ]; then
|
||||
if ./scripts/fix-daily-notification-podspec.sh; then
|
||||
log_success "Daily Notification Plugin podspec symlink created"
|
||||
else
|
||||
log_warn "Failed to create podspec symlink (may already exist)"
|
||||
fi
|
||||
else
|
||||
log_warn "fix-daily-notification-podspec.sh not found, skipping"
|
||||
fi
|
||||
|
||||
safe_execute "Syncing with Capacitor" "run_cap_sync_with_workaround" || exit 6
|
||||
|
||||
# Step 7: Generate assets
|
||||
|
||||
35
scripts/fix-daily-notification-podspec.sh
Executable file
35
scripts/fix-daily-notification-podspec.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
# Fix Daily Notification Plugin Podspec Name
|
||||
# Creates a podspec with the expected name for Capacitor sync
|
||||
|
||||
PLUGIN_DIR="node_modules/@timesafari/daily-notification-plugin"
|
||||
PODSPEC_ACTUAL="CapacitorDailyNotification.podspec"
|
||||
PODSPEC_EXPECTED="TimesafariDailyNotificationPlugin.podspec"
|
||||
|
||||
if [ -f "$PLUGIN_DIR/$PODSPEC_ACTUAL" ] && [ ! -f "$PLUGIN_DIR/$PODSPEC_EXPECTED" ]; then
|
||||
echo "Creating podspec: $PODSPEC_EXPECTED"
|
||||
cat > "$PLUGIN_DIR/$PODSPEC_EXPECTED" << 'EOF'
|
||||
require 'json'
|
||||
|
||||
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'TimesafariDailyNotificationPlugin'
|
||||
s.version = package['version']
|
||||
s.summary = package['description']
|
||||
s.license = package['license']
|
||||
s.homepage = package['repository']['url']
|
||||
s.author = package['author']
|
||||
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
||||
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
||||
s.ios.deployment_target = '13.0'
|
||||
s.dependency 'Capacitor'
|
||||
s.swift_version = '5.1'
|
||||
end
|
||||
EOF
|
||||
echo "✓ Podspec created successfully"
|
||||
elif [ -f "$PLUGIN_DIR/$PODSPEC_EXPECTED" ]; then
|
||||
echo "ℹ Podspec already exists"
|
||||
else
|
||||
echo "⚠ Actual podspec not found at $PLUGIN_DIR/$PODSPEC_ACTUAL"
|
||||
fi
|
||||
Reference in New Issue
Block a user