I am using CocoaPods v1.16.2 and Xcode 16.3.
I have a native iOS app in which a few screens need to be built using flutter.
For that, I have integrated Flutter into the iOS project using CocoaPods by referring to this.
Flutter frameworks are added as development pods.
When I am trying to build the iOS project, one of the development pods, called FlutterPluginRegistrant, fails to build with the error:
/Users/me/Documents/repos/ios-bingo-international/Pods/Headers/Private/sqflite_darwin/SqflitePlugin.h:10:9:'include/sqflite_darwin/SqflitePluginPublic.h' file not found
While there are a total of 3 includes in the FlutterPluginRegistrant header file that is just below, the other two, except SqflitePlugin.h, have no issues in linking.
#import "GeneratedPluginRegistrant.h"
#if __has_include(<connectivity_plus/ConnectivityPlusPlugin.h>)
#import <connectivity_plus/ConnectivityPlusPlugin.h>
#else
@import connectivity_plus;
#endif
#if __has_include(<path_provider_foundation/PathProviderPlugin.h>)
#import <path_provider_foundation/PathProviderPlugin.h>
#else
@import path_provider_foundation;
#endif
#if __has_include(<sqflite_darwin/SqflitePlugin.h>)
#import <sqflite_darwin/SqflitePlugin.h>
#else
@import sqflite_darwin;
#endif
@implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[ConnectivityPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"ConnectivityPlusPlugin"]];
[PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]];
[SqflitePlugin registerWithRegistrar:[registry registrarForPlugin:@"SqflitePlugin"]];
}
/*
If I comment out the include statement and usage, lines 21 to 25 and line 33, then the FlutterPluginRegistrant development pod successfully builds.
*/
@end
The actual issue lies in SqflitePlugin.h, where it tries to import #import "include/sqflite_darwin/SqflitePluginPublic.h" and fails to find it.
If I replace #import "include/sqflite_darwin/SqflitePluginPublic.h" with #import "SqflitePluginPublic.h" issue gets resolved.
But I must not edit these dependency pods' source code.
I tried cleaning Flutter, installing pods again, but nothing worked.
I have attached screenshots for better understanding.
Any suggestion to fix this?
//
// SqflitePlugin.h
// sqflite
//
// Created by Alexandre Roux on 24/10/2022.
//
#ifndef SqflitePlugin_h
#define SqflitePlugin_h
//this import causes error
#import "include/sqflite_darwin/SqflitePluginPublic.h"
extern NSString *const SqfliteMethodExecute;;
extern NSString *const SqfliteMethodInsert;
extern NSString *const SqfliteMethodUpdate;
extern NSString *const SqfliteMethodQuery;
extern NSString *const SqfliteErrorBadParam;
extern NSString *const SqliteErrorCode;
extern NSString *const SqfliteParamMethod;
extern NSString *const SqfliteParamSql;
extern NSString *const SqfliteParamSqlArguments;
extern NSString *const SqfliteParamInTransactionChange;
extern NSString *const SqfliteParamNoResult;
extern NSString *const SqfliteParamContinueOnError;
extern NSString *const SqfliteParamResult;
extern NSString *const SqfliteParamError;
extern NSString *const SqfliteParamErrorCode;
extern NSString *const SqfliteParamErrorMessage;
extern NSString *const SqfliteParamErrorData;
extern NSString *const SqfliteParamTransactionId;
// Static helpers
static const int sqfliteLogLevelNone = 0;
static const int sqfliteLogLevelSql = 1;
static const int sqfliteLogLevelVerbose = 2;
extern bool sqfliteHasSqlLogLevel(int logLevel);
// True for verbose debugging
extern bool sqfliteHasVerboseLogLevel(int logLevel);
#endif // SqflitePlugin_h
