Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'sqlite3.h' file not found only on IOS #108

Open
MSKoWa opened this issue Jun 20, 2022 · 6 comments
Open

'sqlite3.h' file not found only on IOS #108

MSKoWa opened this issue Jun 20, 2022 · 6 comments

Comments

@MSKoWa
Copy link

MSKoWa commented Jun 20, 2022

Hi all,

I am recently receiving an odd error when compiling to IOS with my flutter application. If I remove the 'sqlite3_flutter_libs: ^0.5.7' from my pubspec.yaml it compiles without any errors (and also runs without any problems). However, I need the library for thr Android compilaton....

Basically, I am receiving an error that some 'sqlite3.h' file was not found. The output is shown below:

Launching lib/main.dart on iPad in debug mode...
lib/main.dart:1
Automatically signing iOS for device deployment using specified development team in Xcode project: 39CNMM6J7T
Xcode build done.                                           11.9s
Failed to build iOS app
Error output from Xcode build:
↳
    2022-06-20 09:31:08.211 xcodebuild[12642:98218] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    2022-06-20 09:31:08.211 xcodebuild[12642:98218] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    ** BUILD FAILED **
Xcode's output:
↳
    Writing result bundle at path:
    	/var/folders/k3/9lf8jk1n057429t2yt_k_n8c0000gn/T/flutter_tools.DSdRAX/flutter_ios_build_temp_dirIBNtCM/temporary_xcresult_bundle
/.../development/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/ios/Classes/strategies/PhonePermissionStrategy.m:50:35: warning: 'subscriberCellularProvider' is deprecated: first deprecated in iOS 12.0 [-Wdeprecated-declarations]
        CTCarrier *carrier = [netInfo subscriberCellularProvider];
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                      serviceSubscriberCellularProviders
In module 'CoreTelephony' imported from .../development/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/ios/Classes/strategies/PhonePermissionStrategy.m:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h:112:50: note: property 'subscriberCellularProvider' is declared deprecated here
    @property(readonly, retain, nullable) CTCarrier *subscriberCellularProvider API_DEPRECATED_WITH_REPLACEMENT("serviceSubscriberCellularProviders", ios(4.0, 12.0)) API_UNAVAILABLE(macos);
                                                     ^
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h:112:50: note: 'subscriberCellularProvider' has been explicitly marked deprecated here
    1 warning generated.
    .../Projects/.../ios/Pods/AWSCore/AWSCore/Bolts/AWSTask.m:19:72: warning: this old-style function definition is not preceded by a prototype [-Wstrict-prototypes]
    __attribute__ ((noinline)) void awsbf_warnBlockingOperationOnMainThread() {
                                                                           ^
    1 warning generated.
    .../Projects/.../ios/Pods/AWSCore/AWSCore/Logging/AWSDDOSLogger.m:21:8: warning: 'AWSDDOSLogger' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    static AWSDDOSLogger *sharedInstance;
           ^
    In file included from .../Projects/.../ios/Pods/AWSCore/AWSCore/Logging/AWSDDOSLogger.m:16:
    .../Projects/.../ios/Pods/AWSCore/AWSCore/Logging/AWSDDOSLogger.h:29:12: note: 'AWSDDOSLogger' has been marked as being introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    @interface AWSDDOSLogger : AWSDDAbstractLogger <AWSDDLogger>
               ^
    .../Projects/.../ios/Pods/AWSCore/AWSCore/Logging/AWSDDOSLogger.m:21:23: note: annotate 'sharedInstance' with an availability attribute to silence this warning
    static AWSDDOSLogger *sharedInstance;

1 warning generated.
2
    Command CompileSwiftSources failed with a nonzero exit code
    .../Projects/.../ios/Pods/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider/AWSCognitoIdentityUser.m:419:83: warning: undeclared selector 'startCustomAuthentication_v2' [-Wundeclared-selector]
                if (self.pool.isCustomAuth && [self.pool.delegate respondsToSelector:@selector(startCustomAuthentication_v2)]) {
                                                                                      ^
    .../Projects/.../ios/Pods/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider/AWSCognitoIdentityUser.m:420:79: warning: undeclared selector 'startCustomAuthentication_v2' [-Wundeclared-selector]
                    authenticationDelegate = [self.pool.delegate performSelector:@selector(startCustomAuthentication_v2)];
                                                                                  ^
    .../Projects/.../ios/Pods/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider/AWSCognitoIdentityUser.m:461:20: warning: unused variable 'userAttributes' [-Wunused-variable]
            NSString * userAttributes = lastChallenge.challengeParameters[@"userAttributes"];
                       ^
    ..../Projects/.../ios/Pods/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider/AWSCognitoIdentityUser.m:668:53: warning: undeclared selector 'startCustomAuthentication_v2' [-Wundeclared-selector]
                [self.pool.delegate respondsToSelector:@selector(startCustomAuthentication_v2)]) {
                                                        ^
    ..../Projects/.../ios/Pods/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider/AWSCognitoIdentityUser.m:669:118: warning: undeclared selector 'startCustomAuthentication_v2' [-Wundeclared-selector]
                id<AWSCognitoIdentityCustomAuthentication> authenticationDelegate = [self.pool.delegate performSelector:@selector(startCustomAuthentication_v2)];
                                                                                          ^
    .../Projects/.../ios/Pods/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider/AWSCognitoIdentityUser.m:1199:33: warning: 'getMultiFactorAuthenticationCode:mfaCodeCompletionSource:' is deprecated: Use `getMultiFactorAuthenticationCode_v2:mfaCodeCompletionSource:` instead [-Wdeprecated-declarations]
            [authenticationDelegate getMultiFactorAuthenticationCode:authenticationInput mfaCodeCompletionSource:mfaCompletionSource];
                                    ^
    In file included from .../Projects/.../ios/Pods/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider/AWSCognitoIdentityUser.m:8:
    In file included from .../Projects/.../ios/Pods/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider.h:43:
    .../Projects/.../ios/Pods/AWSCognitoIdentityProvider/AWSCognitoIdentityProvider/AWSCognitoIdentityUserPool.h:422:122: note: 'getMultiFactorAuthenticationCode:mfaCodeCompletionSource:' has been explicitly marked deprecated here
                     mfaCodeCompletionSource: (AWSTaskCompletionSource<NSString *> *) mfaCodeCompletionSource __attribute__((deprecated("Use `getMultiFactorAuthenticationCode_v2:mfaCodeCompletionSource:` instead")));
                                                                                          ^
    6 warnings generated.
    In file included from ..../Projects/.../ios/Pods/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
    .../Projects/.../ios/Pods/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:9: fatal error: 'sqlite3.h' file not found
    #import "sqlite3.h"
            ^~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
    .../Projects/.../ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.5.99. (in target 'sqlite3' from project 'Pods')
    Result bundle written to path:
    	/var/folders/k3/9lf8jk1n057429t2yt_k_n8c0000gn/T/flutter_tools.DSdRAX/flutter_ios_build_temp_dirIBNtCM/temporary_xcresult_bundle
Could not build the precompiled application for the device.
Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code

Lexical or Preprocessor Issue (Xcode): 'sqlite3.h' file not found
..../Projects/.../ios/Pods/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:26:8


Error launching application on iPad.

My problem is: I have no idea when this issue came up because I always compiled for Android when testing. After a few commits I tested the app for IOS before releasing and was confronted with this error...

Does anyone have experiences with such a case?

Best regards and thanks

@simolus3
Copy link
Owner

It looks like some AWS thing is depending on the SQLite.swift pod, which links SQLCipher which is incompatible with sqlite3_flutter_libs linking sqlite3.

Just out of interest, does it work if you depend on sqlcipher_flutter_libs?

@MSKoWa
Copy link
Author

MSKoWa commented Jun 20, 2022

No, this does not work either having the same error. On Android I also receive the following:

Unhandled Exception: Invalid argument(s): Failed to load dynamic library '/data/data/xxx/lib/libsqlite3.so': dlopen failed: library "/data/data/xxx/lib/libsqlite3.so" not found

when compiling

@daniloapr
Copy link

daniloapr commented Jul 21, 2022

I also can't install on iOS, using an Mac M1, sqlite3_flutter_libs: ^0.5.8 . It works fine for Android.

Running Xcode build...                                                  
Xcode build done.                                            3.7s
Failed to build iOS app
Error output from Xcode build:
↳
    2022-07-21 00:15:26.612 xcodebuild[32717:3137737] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension
    Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    2022-07-21 00:15:26.612 xcodebuild[32717:3137737] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension
    Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    ** BUILD FAILED **


Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/3x/g7bqrncn3qbc0gb1kkgy35rw0000gn/T/flutter_tools.pLLh4Q/flutter_ios_build_temp_dirC83jmq/temporary_xcresult_bundle

    In file included from /Users/.../.../.../ios/Pods/SQLite.swift/Sources/SQLiteObjc/SQLiteObjc.m:26:
    /Users/.../.../.../ios/Pods/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:27:9: fatal error: 'sqlite3.h' file not found
    #import "sqlite3.h"
            ^~~~~~~~~~~
    1 error generated.
    Command CompileSwiftSources failed with a nonzero exit code
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order

    Result bundle written to path:
        /var/folders/3x/g7bqrncn3qbc0gb1kkgy35rw0000gn/T/flutter_tools.pLLh4Q/flutter_ios_build_temp_dirC83jmq/temporary_xcresult_bundle


Could not build the precompiled application for the device.
Lexical or Preprocessor Issue (Xcode): 'sqlite3.h' file not found
/Users/.../.../.../ios/Pods/SQLite.swift/Sources/SQLiteObjc/fts3_tokenizer.h:26:8

Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code

I already tried the following (sometimes it fixes for Mac M1), but it didn't work.

cd ios
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.4, on macOS 12.4 21F79 darwin-arm, locale en-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc2)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.69.1)
[✓] Connected device (3 available)
    ! Error: iPhone de Danilo is not connected. Xcode will continue when iPhone de Danilo is connected. (code -13)
[✓] HTTP Host Availability

• No issues found!

@daniloapr
Copy link

I don't know if this could affect the issue, but I have a background service that accesses the database from Swift code. So I have pod 'SQLite.swift', '~> 0.12.2' in my Podfile.

@kuhnroyal
Copy link
Contributor

The error above comes from the SQLite.swift pod, so yea, that is probably the cause of the problem. No idea how to fix it.

@simolus3
Copy link
Owner

I think this may be because SQLite.swift links sqlite via spec.library, while the setup used by sqlite3_flutter_libs is intended to not use the system's sqlite3 and instead compile a fixed sqlite3 version from source.

I see that the SQLite.swift pod contains two subspecs (standard and sqlite3): https://github.com/stephencelis/SQLite.swift/blob/dd3e813577b8b6ba363b12cff024dd633e9e29ab/SQLite.swift.podspec#L31-L62. The sqlite3 subspec seems to depend on the sqlite3 pod (which is also used by sqlite3_flutter_libs and should be compatible). Do you have a way to depend on that pod instead (e.g. SQLite.swift/sqlite3)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@kuhnroyal @simolus3 @daniloapr @MSKoWa and others