apache / cordova-plugin-inappbrowser

Apache Cordova InAppBrowser Plugin
https://cordova.apache.org/
Apache License 2.0
1.11k stars 2.14k forks source link

Cannot build iOS Ionic Capacitor project #1039

Closed zarko-tg closed 5 months ago

zarko-tg commented 5 months ago

Building for iOS using cordova-plugin-inappbrowser 6.0.0 fails.

...
/Users/user/project/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginInappbrowser/CDVWKInAppBrowser.m:22:9: fatal error: 'Cordova/CDVWebViewProcessPoolFactory.h' file not found
#import <Cordova/CDVWebViewProcessPoolFactory.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/user/project/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginInappbrowser/CDVWKInAppBrowser.m:22:9: note: did not find header 'CDVWebViewProcessPoolFactory.h' in
      framework 'Cordova' (loaded from
      '/Users/user/Library/Developer/Xcode/DerivedData/App-dhqnmyemtxyfryeexvhkkexwfcbw/Build/Intermediates.noindex/ArchiveIntermediates/App/BuildProductsPath/Release-iphoneos/CapacitorCordova')
1 error generated.
...
** ARCHIVE FAILED **

Ionic:

Ionic CLI : 7.1.5 Ionic Framework : @ionic/angular 6.7.1 @angular-devkit/build-angular : 17.0.3 @angular-devkit/schematics : 17.0.3 @angular/cli : 17.0.3 @ionic/angular-toolkit : 10.0.0

Capacitor:

Capacitor CLI : 5.5.1 @capacitor/android : 5.5.1 @capacitor/core : 5.5.1 @capacitor/ios : 5.5.1

Utility:

cordova-res : not installed globally native-run (update available: 2.0.0) : 1.7.4

System:

NodeJS : v20.10.0 npm : 10.2.3 OS : macOS Unknown

Checklist

breautek commented 5 months ago

Does it build with a vanilla cordova-ios?

zarko-tg commented 5 months ago

@breautek I did a quick test, it seems fine on a vanilla project, no iOS build failure.

breautek commented 5 months ago

Thanks, then it seems the issue is within the capacitor/ionic framework. I don't think there is anything actionable by Cordova.

gabides commented 5 months ago

I am facing the same issue and it looks like it is coming from this PR https://github.com/apache/cordova-plugin-inappbrowser/pull/1031/files#diff-3a6f80dde729cc2827f9bb45fed1ba49af846f71424cc0567c754309ea1798dcR22

when reverting this change, the error stops and the build succeeds on Capacitor. @jcesarmobile any chance that we can add a similar condition which will skip this import on a capacitor app?

zarko-tg commented 5 months ago

FYI, it looks like this issue will be addressed in the next Capacitor version: https://github.com/ionic-team/capacitor/pull/7096