API error on iOS12 + UIWebView

When I tap the input tag on iOS12 device, following error message appears in XCode.

API error: <_UIKBCompatInputView: 0x104865780; frame = (0 0; 0 0); layer = <CALayer: 0x280679c80>> returned 0 width, assuming UIViewNoIntrinsicMetric

There is no problem with iOS11.

Because of this API error, Japanese character input fails.

I know that UIWebView will be discontinued, but my current project was developed about 4 years ago and it is necessary to do a lot of regression testing when updating to WkWebView, so I would like to solve it without changing from UIWebView.

Is there any solution?


How to reproduce

ionic start trial_app tabs --cordova --type ionic1 --no-git --no-link
cd trial_app

ionic cordova platform add ios@4.5
ionic cordova plugin rm cordova-plugin-ionic-webview
ionic cordova plugin rm cordova-plugin-ionic-keyboard

add input tag to tab-dash.html

<ion-view view-title="Dashboard">
  <ion-content class="padding">
      <h2>Welcome to Ionic</h2>
      <input type="text> // added
      ...

1 Like

Hello kojima

i am also facing the same issue did you find any solution to this

Unfortunately, not yet. Since this is due to iOS 12 specification change, it may not be expected that problems will be improved with the old UIWebview.

so did you change to the WkWebView ? if you have what all issues did you face after the migration to WkWebView

I haven’t changed to the WkWebview yet. If I do that, I think that I have to migrate the data in UIWebView to WkWebview using a native tools like Android’s cordova-plugin-crosswalk-data-migration. Because my app uses UIWevView’s localstorage.

so how are you tackling this problem on your app.

Actually, the problem in my App is “Done” button on the software keyboard.
On iOS 12, the value in input field (<input> tag) is displayed properly, but when I close the software keyboard by tapping “Done” button, the inputed value is not copied to ng-model.

If I close the software keyboard by tapping other field or by tapping next focus botton on the software keyboard, the value copied to ng-model.

So, I changed my code to hide “Done” button by calling “hideKeyboardAccessoryBar(true)” when the field is input field.
Otherwise (<select> tag), to show “Done” button by calling “hideKeyboardAccessoryBar(false)”.

I was getting API errors that led to the LayoutContraints errors. I was running old ionic-plugin-keyboard and removed it and added back in Cordova-plugin-ionic-keyboard. That eliminated the LayoutContraint errors but I still get the API error. everything seems to work just fine though.