diff --git a/ios/DailyNotificationPlugin.podspec b/ios/DailyNotificationPlugin.podspec index 0b374ae..fd528d2 100644 --- a/ios/DailyNotificationPlugin.podspec +++ b/ios/DailyNotificationPlugin.podspec @@ -11,7 +11,13 @@ Pod::Spec.new do |s| s.dependency 'Capacitor', '>= 5.0.0' s.dependency 'CapacitorCordova', '>= 5.0.0' s.swift_version = '5.1' - s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1' } + # Explicitly link against system SQLite library to avoid conflicts with + # macOS SQLite libraries (e.g., from pkgx or other package managers that + # may set DYLD_LIBRARY_PATH or similar environment variables) + s.xcconfig = { + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1', + 'OTHER_LDFLAGS' => '$(inherited) -lsqlite3' + } s.deprecated = false # Set to false so Capacitor can discover the plugin # Capacitor iOS does not scan static frameworks for plugin discovery diff --git a/scripts/build-native.sh b/scripts/build-native.sh index cb61152..f5fc743 100755 --- a/scripts/build-native.sh +++ b/scripts/build-native.sh @@ -149,6 +149,15 @@ build_plugin_for_test_app() { build_plugin_for_test_app_ios() { log_info "Building iOS test app..." + # Warn about pkgx interference with SQLite linking + if [ -n "$PKGX_DIR" ] || [ -d "$HOME/.pkgx" ]; then + log_warn "⚠️ pkgx detected - this may interfere with iOS SQLite linking" + log_warn " Temporarily unsetting PKGX_DIR and DYLD_LIBRARY_PATH for build..." + unset PKGX_DIR + unset DYLD_LIBRARY_PATH + unset LD_LIBRARY_PATH + fi + # Ensure symlink is in place FIRST (before building) # The test app expects the plugin at node_modules/@timesafari/daily-notification-plugin SYMLINK="test-apps/daily-notification-test/node_modules/@timesafari/daily-notification-plugin" @@ -374,6 +383,13 @@ build_ios() { exit 1 fi + # Warn about pkgx interference with SQLite linking + if [ -n "$PKGX_DIR" ] || [ -d "$HOME/.pkgx" ]; then + log_warn "⚠️ pkgx detected - this may interfere with iOS SQLite linking" + log_warn " If you see 'sqlite3' undefined symbol errors, try:" + log_warn " unset PKGX_DIR && unset DYLD_LIBRARY_PATH && ./scripts/build-native.sh --platform ios" + fi + # Detect project type if [ -d "test-apps/daily-notification-test" ]; then log_info "Detected test app. Building plugin and test app together..."