title: Error inflating class android.webkit.WebView
body: <p>I'm facing an unusual issue where i'm not able to use webview anywhere in my app.
  It is giving following exception.</p>
  <pre><code>    Caused by: android.view.InflateException: Binary XML file line #35: Binary XML file line #35: Error inflating class android.webkit.WebView
       Caused by: android.view.InflateException: Binary XML file line #35: Error inflating class android.webkit.WebView
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Constructor.newInstance0(Native Method)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
          at android.view.LayoutInflater.createView(LayoutInflater.java:647)
          at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
          at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:699)
          at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
          at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303)
          at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
          at com.mobile.base.BaseActivity.onCreate(BaseActivity.kt:26)
          at com.mobile.module.web_view.Hilt_FSWebViewActivity.onCreate(Hilt_FSWebViewActivity.java:21)
          at android.app.Activity.performCreate(Activity.java:6975)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
          at android.app.ActivityThread.-wrap11(Unknown Source:0)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
          at android.os.Handler.dispatchMessage(Handler.java:105)
          at android.os.Looper.loop(Looper.java:164)
          at android.app.ActivityThread.main(ActivityThread.java:6541)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
       Caused by: android.util.AndroidRuntimeException: java.lang.reflect.InvocationTargetException
          at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:230)
          at android.webkit.WebView.getFactory(WebView.java:2467)
          at android.webkit.WebView.ensureProviderCreated(WebView.java:2462)
          at android.webkit.WebView.setOverScrollMode(WebView.java:2527)
          at android.view.View.&lt;init&gt;(View.java:4536)
          at android.view.View.&lt;init&gt;(View.java:4668)
          at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:597)
          at android.widget.AbsoluteLayout.&lt;init&gt;(AbsoluteLayout.java:55)
  2021-05-10 20:05:57.056 28318-28318/com.mobile E/AndroidRuntime:     at android.webkit.WebView.&lt;init&gt;(WebView.java:636)
          at android.webkit.WebView.&lt;init&gt;(WebView.java:581)
          at android.webkit.WebView.&lt;init&gt;(WebView.java:564)
          at android.webkit.WebView.&lt;init&gt;(WebView.java:551)
              ... 30 more
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Method.invoke(Native Method)
          at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:225)
              ... 41 more
       Caused by: java.lang.RuntimeException: Package not found: com.android.chrome
          at android.webkit.WebViewDelegate.getPackageId(WebViewDelegate.java:164)
          at sX3.b(chromium-Monochrome.aab-stable-443009121:1)
          at com.android.webview.chromium.WebViewChromiumFac`enter code here`toryProvider.e(chromium-Monochrome.aab-stable-443009121:35)
          at com.android.webview.chromium.WebViewChromiumFactoryProvider.&lt;init&gt;(chromium-Monochrome.aab-stable-443009121:12)
          at com.android.webview.chromium.WebViewChromiumFactoryProviderForO.&lt;init&gt;(chromium-Monochrome.aab-stable-443009121:1)
          at com.android.webview.chromium.WebViewChromiumFactoryProviderForO.create(chromium-Monochrome.aab-stable-443009121:1)
              ... 43 more
  </code></pre>
  <p>I created a different app with only one activity containing webview and it is working fine.</p>
  <p><strong>Please help me in understanding what might be the issue.</strong></p>
  <pre><code>compileSdkVersion 29
  minSdkVersion 24
  targetSdkVersion 29
  
  // Android Libraries
  implementation 'androidx.appcompat:appcompat:1.3.0-rc01'
  implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  implementation 'androidx.cardview:cardview:1.0.0'
  implementation 'androidx.recyclerview:recyclerview:1.2.0'
  implementation 'androidx.multidex:multidex:2.0.1'
  implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  implementation 'androidx.fragment:fragment-ktx:1.3.3'
  
  
  // Google Libraries
  //implementation 'com.google.code.gson:gson:2.8.6'
  
  // Kotlin Libraries
  implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.21&quot;
  
  // Rx
  implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
  implementation &quot;io.reactivex.rxjava2:rxandroid:2.1.1&quot;
  implementation 'io.reactivex:rxandroid:1.2.1'
  
  // Retrofit
  implementation 'com.squareup.retrofit2:retrofit:2.7.0'
  implementation 'com.squareup.retrofit2:adapter-rxjava:2.5.0'
  implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
  implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
  //implementation 'com.squareup.okhttp3:okhttp:4.7.2'
  implementation 'com.squareup.okhttp3:logging-interceptor:4.3.1'
  implementation 'io.reactivex:rxandroid:1.2.1'
  
  // Image Processing
  implementation('com.github.bumptech.glide:glide:4.11.0')/* {
      exclude group: &quot;com.android.support&quot;
  }*/
  //implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  kapt 'com.github.bumptech.glide:compiler:4.11.0'
  
  // ROOM
  implementation 'androidx.room:room-runtime:2.2.6'
  kapt 'androidx.room:room-compiler:2.2.6'
  testImplementation &quot;androidx.room:room-testing:2.2.6&quot;
  
  // Testing Libraries
  testImplementation 'junit:junit:4.13'
  androidTestImplementation 'androidx.test.ext:junit:1.1.2'
  androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
  
  //HILT - DI Dependencies
  implementation &quot;com.google.dagger:hilt-android:$hilt_version&quot;
  implementation &quot;androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03&quot;
  implementation &quot;com.google.dagger:hilt-android:$hilt_version&quot;
  kapt &quot;com.google.dagger:hilt-android-compiler:$hilt_version&quot;
  kapt 'androidx.hilt:hilt-compiler:1.0.0-beta01'
  kapt &quot;com.google.dagger:hilt-android-compiler:$hilt_version&quot;
  
  //Lifecycle
  implementation &quot;androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1&quot;
  implementation &quot;androidx.lifecycle:lifecycle-extensions:2.2.0&quot;
  
  //Data binding
  annotationProcessor 'androidx.databinding:databinding-compiler:4.1.3'
  
  //Navigation
  implementation &quot;androidx.navigation:navigation-fragment-ktx:$nav_version&quot;
  implementation &quot;androidx.navigation:navigation-ui-ktx:$nav_version&quot;
  
  //Material Design Components
  implementation 'com.google.android.material:material:1.3.0'
  
  //Coroutines
  def coroutines_version = &quot;1.4.1&quot;
  implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version&quot;
  implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version&quot;
  
  //Lifecycle LiveData
  def lifecycle_version = &quot;2.3.1&quot;
  implementation &quot;androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version&quot;
  
  implementation project(path: ':googlecloudtts')
  
  // Dynamic Feature Module Support
  implementation &quot;androidx.navigation:navigation-dynamic-features-fragment:$nav_version&quot;
  
  implementation 'com.google.android.material:material:1.4.0-alpha02'
  
  implementation 'com.romandanylyk:pageindicatorview:1.0.3'
  
  implementation 'org.jsoup:jsoup:1.13.1'
  
  implementation 'com.google.android.gms:play-services-auth:19.0.0'
  
  implementation ('com.akexorcist:localization:1.2.9') {
      exclude group: 'androidx.core', module: 'core'
  }
  
  implementation 'com.ramotion.directselect:direct-select:0.1.1'
  
  implementation platform('com.google.firebase:firebase-bom:27.1.0')
  implementation 'com.google.firebase:firebase-analytics'
  
  implementation 'org.conscrypt:conscrypt-android:2.2.1'
  
  implementation platform('com.google.firebase:firebase-bom:27.1.0')
  implementation &quot;com.google.firebase:firebase-messaging:21.1.0&quot;
  implementation 'com.google.firebase:firebase-core:18.0.3'
  implementation 'com.google.firebase:firebase-analytics'
  </code></pre>
  <p><strong>Project level gradle:</strong>
  <a href="https://i.stack.imgur.com/oDb20.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oDb20.png" alt="enter image description here" /></a></p>
  <p><strong>Project has an other submodule which has a module level dependencies as below:</strong></p>
  <pre><code>implementation fileTree(dir: 'libs', include: ['*.jar'])
  
  implementation 'androidx.appcompat:appcompat:1.3.0-rc01'
  
  implementation 'com.squareup.okhttp3:okhttp:4.7.2'
  implementation 'com.google.code.gson:gson:2.8.6'
  
  testImplementation 'junit:junit:4.13.1'
  testImplementation 'org.json:json:20160810'
  androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
  implementation &quot;androidx.core:core-ktx:1.3.2&quot;
  implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
  
  implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
  implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
  </code></pre>