title: Flutter PlatformViews: Trying to create a platform view of unregistered type
body: <p>So, I followed this <a href="https://60devs.com/how-to-add-native-code-to-flutter-app-using-platform-views-android.html" rel="nofollow noreferrer">article</a> from 60devs, on how to implement native Webview in flutter using PlatformView. I followed the article exactly but I get this error:</p>
  
  <pre><code>Unhandled Exception: PlatformException(error, Trying to create a platform view of unregistered type: webview, null)
  </code></pre>
  
  <blockquote>
    <ul>
    <li>My minimum SDK version is greater than 20 (21 currently).</li>
    <li>I have <strong>internet permission</strong> in my <code>AndroidManifest.xml</code> file.</li>
    <li>I have tried <code>flutter clean</code>.</li>
    </ul>
  </blockquote>
  
  <p>But nothing works.</p>
  
  <p>flutter run error:</p>
  
  <pre><code>E/flutter ( 8794): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, Trying to create a platform view of unregistered type: webview, null)
  E/flutter ( 8794): #0      StandardMethodCodec.decodeEnvelope 
  package:flutter/…/services/message_codecs.dart:564
  E/flutter ( 8794): #1      MethodChannel.invokeMethod 
  package:flutter/…/services/platform_channel.dart:316
  E/flutter ( 8794): &lt;asynchronous suspension&gt;
  E/flutter ( 8794): #2      AndroidViewController._create 
  package:flutter/…/services/platform_views.dart:639
  E/flutter ( 8794): &lt;asynchronous suspension&gt;
  E/flutter ( 8794): #3      AndroidViewController.setSize 
  package:flutter/…/services/platform_views.dart:556
  E/flutter ( 8794): &lt;asynchronous suspension&gt;
  E/flutter ( 8794): #4      RenderAndroidView._sizePlatformView 
  package:flutter/…/rendering/platform_view.dart:189
  E/flutter ( 8794): &lt;asynchronous suspension&gt;
  E/flutter ( 8794): #5      RenderAndroidView.performResize 
  package:flutter/…/rendering/platform_view.dart:170
  E/flutter ( 8794): #6      RenderObject.layout 
  package:flutter/…/rendering/object.dart:1604
  E/flutter ( 8794): #7      _RenderProxyBox&amp;RenderBox&amp;RenderObjectWithChildMixin&amp;RenderProxyBoxMixin.performLayout 
  package:flutter/…/rendering/proxy_box.dart:105
  E/flutter ( 8794): #8      RenderObject.layout 
  package:flutter/…/rendering/object.dart:1619
  E/flutter ( 8794): #9      _RenderProxyBox&amp;RenderBox&amp;RenderObjectWithChildMixin&amp;RenderProxyBoxMixin.performLayout 
  package:flutter/…/rendering/proxy_box.dart:105
  E/flutter ( 8794): #10     RenderObject.layout 
  package:flutter/…/rendering/object.dart:1619
  E/flutter ( 8794): #11     _RenderProxyBox&amp;RenderBox&amp;RenderObjectWithChildMixin&amp;RenderProxyBoxMixin.performLayout 
  package:flutter/…/rendering/proxy_box.dart:105
  E/flutter ( 8794): #12     RenderObject.layout 
  package:flutter/…/rendering/object.dart:1619
  E/flutter ( 8794): #13     _RenderProxyBox&amp;RenderBox&amp;RenderObjectWithChildMixin&amp;RenderProxyBoxMixin.performLayout 
  package:flutter/…/rendering/proxy_box.dart:105
  E/flutter ( 8794): #14     RenderObject.layout 
  package:flutter/…/rendering/object.dart:1619
  E/flutter ( 8794): #15     _RenderProxyBox&amp;RenderBox&amp;RenderObjectWithChildMixin&amp;RenderProxyBoxMixin.performLayout 
  package:flutter/…/rendering/proxy_box.dart:105
  E/flutter ( 8794): #16     RenderObject.layout 
  package:flutter/…/rendering/object.dart:1619
  E/flutter ( 8794): #17     _RenderProxyBox&amp;RenderBox&amp;RenderObjectWithChildMixin&amp;RenderProxyBoxMixin.performLayout 
  package:flutter/…/rendering/proxy_box.dart:105
  E/flutter ( 8794): #18     RenderObject.layout 
  package:flutter/…/rendering/object.dart:1619
  E/flutter ( 8794): #19     _RenderProxyBox&amp;RenderBox&amp;RenderObjectWithChildMixin&amp;RenderProxyBoxMixin.performLayout 
  package:flutter/…/rendering/proxy_box.dart:105
  E/flutter ( 8794): #20     RenderObject.layout 
  package:flutter/…/rendering/object.dart:1619
  E/flutter ( 8794): #21     RenderOffstage.performLayout 
  package:flutter/…/rendering/proxy_box.dart:3074
  </code></pre>
  
  <p>Can you <strong>please</strong> look at the code in this <a href="https://60devs.com/how-to-add-native-code-to-flutter-app-using-platform-views-android.html" rel="nofollow noreferrer">article</a>, it's short and simple. And tell me what went wrong?</p>