fix(ios): resolve compilation errors and enable successful build
Fixed critical compilation errors preventing iOS plugin build: - Updated logger API calls from logger.debug(TAG, msg) to logger.log(.debug, msg) across all iOS plugin files to match DailyNotificationLogger interface - Fixed async/await concurrency in makeConditionalRequest using semaphore pattern - Fixed NotificationContent immutability by creating new instances instead of mutation - Changed private access control to internal for extension-accessible methods - Added iOS 15.0+ availability checks for interruptionLevel property - Fixed static member references using Self.MEMBER_NAME syntax - Added missing .scheduling case to exhaustive switch statement - Fixed variable initialization in retry state closures Added DailyNotificationStorage.swift implementation matching Android pattern. Updated build scripts with improved error reporting and full log visibility. iOS plugin now compiles successfully. All build errors resolved.
This commit is contained in:
@@ -156,7 +156,23 @@ check_environment_ios() {
|
||||
# Check for CocoaPods
|
||||
if ! command -v pod &> /dev/null; then
|
||||
log_error "CocoaPods not found. Install with:"
|
||||
log_error " sudo gem install cocoapods"
|
||||
log_info " gem install cocoapods"
|
||||
|
||||
# Check if rbenv is available and suggest reloading
|
||||
if [ -n "$RBENV_ROOT" ] || [ -d "$HOME/.rbenv" ]; then
|
||||
log_info "Or if using rbenv, ensure shell is reloaded:"
|
||||
log_info " source ~/.zshrc # or source ~/.bashrc"
|
||||
log_info " gem install cocoapods"
|
||||
fi
|
||||
|
||||
# Check if setup script exists
|
||||
if [ -f "$SCRIPT_DIR/setup-ruby.sh" ]; then
|
||||
log_info ""
|
||||
log_info "You can also run the setup script first:"
|
||||
log_info " ./scripts/setup-ruby.sh"
|
||||
log_info " gem install cocoapods"
|
||||
fi
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -408,21 +424,35 @@ build_ios() {
|
||||
IOS_SDK_VERSION=$(xcrun --show-sdk-version --sdk iphoneos 2>&1)
|
||||
log_info "Found iOS SDK: $IOS_SDK_VERSION"
|
||||
|
||||
# Check if platform components are installed by trying a dry-run
|
||||
DRY_RUN_OUTPUT=$(xcodebuild -workspace "$WORKSPACE" \
|
||||
-scheme "$SCHEME" \
|
||||
-destination 'generic/platform=iOS' \
|
||||
-dry-run 2>&1)
|
||||
|
||||
if echo "$DRY_RUN_OUTPUT" | grep -q "iOS.*is not installed"; then
|
||||
log_warn "iOS device platform components not installed"
|
||||
log_info "To install iOS device platform components, run:"
|
||||
log_info " xcodebuild -downloadPlatform iOS"
|
||||
log_info "Or via Xcode: Settings > Components > iOS $IOS_SDK_VERSION"
|
||||
log_info ""
|
||||
log_info "Building for iOS Simulator instead (sufficient for plugin development)"
|
||||
# Check if platform components are installed by trying a list command
|
||||
# Note: -dry-run is not supported in new build system, so we check SDK availability differently
|
||||
if xcodebuild -showsdks 2>&1 | grep -q "iphoneos"; then
|
||||
# Try to validate SDK path exists
|
||||
SDK_PATH=$(xcrun --show-sdk-path --sdk iphoneos 2>&1)
|
||||
if [ $? -eq 0 ] && [ -d "$SDK_PATH" ]; then
|
||||
# Check if we can actually build (by trying to list build settings)
|
||||
LIST_OUTPUT=$(xcodebuild -workspace "$WORKSPACE" \
|
||||
-scheme "$SCHEME" \
|
||||
-destination 'generic/platform=iOS' \
|
||||
-showBuildSettings 2>&1 | head -5)
|
||||
|
||||
if echo "$LIST_OUTPUT" | grep -q "iOS.*is not installed"; then
|
||||
log_warn "iOS device platform components not installed"
|
||||
log_info "To install iOS device platform components, run:"
|
||||
log_info " xcodebuild -downloadPlatform iOS"
|
||||
log_info "Or via Xcode: Settings > Components > iOS $IOS_SDK_VERSION"
|
||||
log_info ""
|
||||
log_info "Building for iOS Simulator instead (sufficient for plugin development)"
|
||||
else
|
||||
BUILD_DEVICE=true
|
||||
fi
|
||||
else
|
||||
log_warn "iOS SDK path not accessible: $SDK_PATH"
|
||||
log_info "Building for iOS Simulator instead"
|
||||
fi
|
||||
else
|
||||
BUILD_DEVICE=true
|
||||
log_warn "iOS device SDK not found in xcodebuild -showsdks"
|
||||
log_info "Building for iOS Simulator instead"
|
||||
fi
|
||||
else
|
||||
log_warn "iOS SDK not found"
|
||||
@@ -443,13 +473,37 @@ build_ios() {
|
||||
CODE_SIGNING_ALLOWED=NO \
|
||||
2>&1)
|
||||
|
||||
BUILD_EXIT_CODE=$?
|
||||
|
||||
if echo "$BUILD_OUTPUT" | grep -q "error.*iOS.*is not installed"; then
|
||||
log_warn "iOS device build failed - platform components not installed"
|
||||
echo "$BUILD_OUTPUT" > /tmp/xcodebuild_device.log
|
||||
log_info "Check build log: /tmp/xcodebuild_device.log"
|
||||
BUILD_DEVICE=false
|
||||
elif echo "$BUILD_OUTPUT" | grep -q "BUILD FAILED"; then
|
||||
log_warn "iOS device build failed"
|
||||
log_info ""
|
||||
log_info "=== DEVICE BUILD ERRORS ==="
|
||||
echo "$BUILD_OUTPUT" | grep -E "(error:|warning:|BUILD FAILED)"
|
||||
echo "$BUILD_OUTPUT" > /tmp/xcodebuild_device.log
|
||||
log_info ""
|
||||
log_info "Full build log saved to: /tmp/xcodebuild_device.log"
|
||||
log_info "View full log: cat /tmp/xcodebuild_device.log"
|
||||
log_info "Falling back to simulator build..."
|
||||
BUILD_DEVICE=false
|
||||
elif echo "$BUILD_OUTPUT" | grep -q "BUILD SUCCEEDED"; then
|
||||
log_info "✓ iOS device build completed"
|
||||
elif [ $BUILD_EXIT_CODE -ne 0 ]; then
|
||||
log_warn "iOS device build failed (exit code: $BUILD_EXIT_CODE)"
|
||||
log_info ""
|
||||
log_info "=== DEVICE BUILD ERRORS ==="
|
||||
echo "$BUILD_OUTPUT" | grep -E "(error:|warning:|BUILD FAILED)"
|
||||
echo "$BUILD_OUTPUT" > /tmp/xcodebuild_device.log
|
||||
log_info ""
|
||||
log_info "Full build log saved to: /tmp/xcodebuild_device.log"
|
||||
log_info "View full log: cat /tmp/xcodebuild_device.log"
|
||||
log_info "Falling back to simulator build..."
|
||||
BUILD_DEVICE=false
|
||||
else
|
||||
log_warn "iOS device build completed with warnings"
|
||||
echo "$BUILD_OUTPUT" > /tmp/xcodebuild_device.log
|
||||
@@ -470,11 +524,31 @@ build_ios() {
|
||||
CODE_SIGNING_ALLOWED=NO \
|
||||
2>&1)
|
||||
|
||||
SIMULATOR_EXIT_CODE=$?
|
||||
|
||||
# Save full output to log file
|
||||
echo "$SIMULATOR_BUILD_OUTPUT" > /tmp/xcodebuild_simulator.log
|
||||
|
||||
if echo "$SIMULATOR_BUILD_OUTPUT" | grep -q "BUILD SUCCEEDED"; then
|
||||
log_info "✓ iOS simulator build completed successfully"
|
||||
elif echo "$SIMULATOR_BUILD_OUTPUT" | grep -q "error:"; then
|
||||
log_error "iOS simulator build failed"
|
||||
echo "$SIMULATOR_BUILD_OUTPUT" | grep -E "(error:|warning:)" | head -20
|
||||
log_info ""
|
||||
log_info "Full error output:"
|
||||
echo "$SIMULATOR_BUILD_OUTPUT" | grep -E "(error:|warning:)"
|
||||
log_info ""
|
||||
log_info "Full build log saved to: /tmp/xcodebuild_simulator.log"
|
||||
log_info "View full log: cat /tmp/xcodebuild_simulator.log"
|
||||
log_info "View errors only: grep -E '(error:|warning:)' /tmp/xcodebuild_simulator.log"
|
||||
exit 1
|
||||
elif [ $SIMULATOR_EXIT_CODE -ne 0 ]; then
|
||||
log_error "iOS simulator build failed (exit code: $SIMULATOR_EXIT_CODE)"
|
||||
log_info ""
|
||||
log_info "Build output (last 50 lines):"
|
||||
echo "$SIMULATOR_BUILD_OUTPUT" | tail -50
|
||||
log_info ""
|
||||
log_info "Full build log saved to: /tmp/xcodebuild_simulator.log"
|
||||
log_info "View full log: cat /tmp/xcodebuild_simulator.log"
|
||||
exit 1
|
||||
else
|
||||
log_warn "iOS simulator build completed with warnings"
|
||||
|
||||
Reference in New Issue
Block a user