ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.24k stars 955 forks source link

[Bug]: iOS App fails to build with 'WKWebView+Capacitor.h: No such file or directory' after migrating existing app to Cap v6 #7414

Closed ndrake closed 4 weeks ago

ndrake commented 4 weeks ago

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/android: 6.0.0 @capacitor/ios: 6.0.0

Installed Dependencies:

@capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/android: 6.0.0 @capacitor/ios: 6.0.0

[success] iOS looking great! 👌 [success] Android looking great! 👌

Other API Details

npm: 10.2.3
node: v18.19.0
pod: 1.14.3

Platforms Affected

Current Behavior

After following the v6 migration (using npx cap migrate) when I attempt to run the iOS via XCode if fails with:

/path/to/myapp/node_modules/@capacitor/ios/Capacitor/Capacitor/WKWebView+Capacitor.h /path/to/myapp/node_modules/@capacitor/ios/Capacitor/Capacitor/WKWebView+Capacitor.h: No such file or directory

Expected Behavior

The iOS app runs/builds ok.

Project Reproduction

Will work on creating this

Additional Information

Our app does use some Cordova plugins, specifically:

cordova-plugin-calendar cordova-plugin-device cordova-plugin-file cordova-plugin-file-transfer cordova-plugin-inappbrowser cordova-plugin-tv-detect

Our Capacitor config:

{
  "appId": "com.example.blah",
  "appName": "Our App",
  "bundledWebRuntime": false,
  "webDir": "dist",
  "plugins": {
    "SplashScreen": {
      "launchShowDuration": 0
    },
    "CapacitorHttp": {
      "enabled": true
    }
  },
  "server": {
    "androidScheme": "https"
  },
  "cordova": {
  },
  "ios": {
    "appendUserAgent": "ios:application"
  },
  "android": {
    "buildOptions": {
      "signingType": "apksigner"
    }
  }
}

The WKWebView+Capacitor.h header file did exist with Capacitor 5.

ndrake commented 4 weeks ago

Nevermind, it looks like the issue was that the cap sync for iOS failed during the migration. so ios/App/Pods/Pods.xcodeproj/project.pbxproj still had the header file listed. After getting the sync working, it seems good.