Home > Enterprise >  The app references non-public selectors in Payload Capacitor.Framework STATE_ERROR.VALIDATION_ERROR.
The app references non-public selectors in Payload Capacitor.Framework STATE_ERROR.VALIDATION_ERROR.

Time:06-07

Today, I ran into a problem while trying to upload my capacitor app to the App Store. The app was published a few days ago and, to my understanding, nothing critical for the upload was not changed. The error I receive also does not shed any lights on the actual problem.

The error looks the following: enter image description here

And says:

The app references non-public selectors in Payload/App.app/Frameworks/Capacitor.Framework/Capacitor: applicationNameForUserAgent, initWithFrame:configuration:, isMainFrame, setNavigationDelegate:, targetFrame With error code STATE_ERROR.VALIDATION_ERROR.50 for id (some guid).

I tried numerous approaches, like regenerating the Certificates and the Provisioning Profile. Nothing helps, and this error blocks the publishing of the app. Looks like something internal to Capacitor, but I can't figure what exactly and what specifically has happened in a couple of days from the last successful app publish.

Any help?

CodePudding user response:

A potential workaround until it will be officially fixed:

I searched the resulting code by Ionic build for applicationNameForUserAgent and isMainFrame—other strings did not match anything—and found one instance for isMainFrame (line 107 was found) in WebViewDelegationHandler and three instances of applicationNameForUserAgent in CAPBridgeViewController (lines 115-120) (all searches in the xCode workspace). I removed all of these lines and the build was magically published.

I found on StackOverflow some thread from 2019 that also blamed (then) cordova-web-view-plugin.

I'm not sure about how bad it is to remove those lines of code, yet at least it offers some sort of a solution, if at all.

I tested on my app and did not observe any flaws.

CodePudding user response:

As Mentioned by Lentyia answer, for me only searching and removing isMainFrame using XCode fixed the issue.

  • Related