Xcode 11.4

I updated to Xcode 11.4 and now my project won’t compile. I guess it’s a good idea not to update to the latest version right away?

Error I’m getting:
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

on file:
Pods>Development Pods>Capacitor>CAPBridge.swift>registerPlugins()

on this line:
let c: AnyClass = classes![i]

debug window says:

2020-03-24 17:52:14.159915-0400 App[53045:17186165] WF: === Starting WebFilter logging for process App
2020-03-24 17:52:14.160038-0400 App[53045:17186165] WF: _userSettingsForUser : (null)
2020-03-24 17:52:14.160149-0400 App[53045:17186165] WF: _WebFilterIsActive returning: NO
2020-03-24 17:52:14.190025-0400 App[53045:17186165] *** NSForwarding: warning: object 0x7fff89115030 of class 'PFEmbeddedMulticasterImplementation' does not implement methodSignatureForSelector: -- trouble ahead
2020-03-24 17:52:14.190217-0400 App[53045:17186165] *** NSForwarding: warning: object 0x7fff89115030 of class 'PFEmbeddedMulticasterImplementation' does not implement doesNotRecognizeSelector: -- abort

Anything I can do to fix? Wait for a capacitor update?

P.S. I am running an Ionic/Vue project if that matters.

1 Like

Update to capacitor 2.0.0-beta.1 (npm install @capacitor/ios@next)

5 Likes

Back in business. Thank you!

I used capacitor 1.4.0, and modify codes directly.

// Wheter to inject the Cordova files
private var injectCordovaFiles = false

/**

  • Set up our Cordova compat by loading all known Cordova plugins and injecting
  • their JS.
    */
    func setupCordovaCompatibility() {
    // var injectCordovaFiles = false
    // var numClasses = UInt32(0);
    // let classes = objc_copyClassList(&numClasses)
    // for i in 0…<Int(numClasses) {
    // let c: AnyClass = classes![i]
    // if class_getSuperclass© == CDVPlugin.self {
    // injectCordovaFiles = true
    // break
    // }
    // }
    // if injectCordovaFiles {
    // exportCordovaJS()
    // registerCordovaPlugins()
    // }
    if injectCordovaFiles {
    exportCordovaJS()
    registerCordovaPlugins()
    }
    }

/**

  • Register all plugins that have been declared
    */
    func registerPlugins() {
    // var numClasses = UInt32(0);
    // let classes = objc_copyClassList(&numClasses)
    // for i in 0…<Int(numClasses) {
    // let c: AnyClass = classes![i]
    // if class_conformsToProtocol(c, CAPBridgedPlugin.self) {
    // let pluginClassName = NSStringFromClass©
    // let pluginType = c as! CAPPlugin.Type
    // let bridgeType = c as! CAPBridgedPlugin.Type
    //
    // registerPlugin(pluginClassName, bridgeType.jsName(), pluginType)
    // }
    // }
    let classCount = objc_getClassList(nil, 0)
    let classes = UnsafeMutablePointer<AnyClass?>.allocate(capacity: Int(classCount))
let releasingClasses = AutoreleasingUnsafeMutablePointer<AnyClass>(classes)
let numClasses: Int32 = objc_getClassList(releasingClasses, classCount)

for i in 0..<Int(numClasses) {
  if let c: AnyClass = classes[i] {
    if class_getSuperclass(c) == CDVPlugin.self {
      injectCordovaFiles = true
    }
    if class_conformsToProtocol(c, CAPBridgedPlugin.self) {
      let pluginClassName = NSStringFromClass(c)
      let pluginType = c as! CAPPlugin.Type
      let bridgeType = c as! CAPBridgedPlugin.Type

      registerPlugin(pluginClassName, bridgeType.jsName(), pluginType)
    }
  }
}
classes.deallocate()

}

Neither of these responses are reasonable for production.

Just downgrade to Xcode 11.3.1 using these instructions. Then once @capacitor/ios@2.0.0 goes live, update.

For those using CI, make sure your XCode version is pointing to 11, and that your XCode 11 directory is pointing at 11.3.1. For Azure Pipelines that looks like:

task: Xcode@5
  enabled: true
  inputs:
    xcodeVersion: 11
    xcodeDeveloperDir: $(XCODE_11_DEVELOPER_DIR)
    # ...

Where XCODE_11_DEVELOPER_DIR = /Applications/Xcode_11.3.1.app/Contents/Developer

My company IT required the Xcode upgrade as it fixed some other issues so it wasn’t an option and it cannot be rolled back.

Same issue here, i postes a bug on capacitor github

I have the same problem, just updated ?