Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

WebViewFactory: error loading provider

Has anyone come across this error while running the emulator during the "Opening a Webpage Within the App" class? When I click on one of my list items my app crashes and the logcat shows the following:

```05-19 11:08:15.866: E/WebViewFactory(590): error loading provider

05-19 11:08:15.866: E/WebViewFactory(590): java.lang.ClassNotFoundException: com.android.webview.chromium.WebViewChromiumFactoryProvider

05-19 11:08:15.866: E/WebViewFactory(590): at java.lang.Class.classForName(Native Method)

05-19 11:08:15.866: E/WebViewFactory(590): at java.lang.Class.forName(Class.java:251)

05-19 11:08:15.866: E/WebViewFactory(590): at java.lang.Class.forName(Class.java:216)

05-19 11:08:15.866: E/WebViewFactory(590): at android.webkit.WebViewFactory.getFactoryClass(WebViewFactory.java:115)

05-19 11:08:15.866: E/WebViewFactory(590): at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:85)```

And also this may make sense to someone as well:

```05-19 11:08:16.016: E/AndroidRuntime(590): FATAL EXCEPTION: main

05-19 11:08:16.016: E/AndroidRuntime(590): Process: com.JLaird.blogreader, PID: 590

05-19 11:08:16.016: E/AndroidRuntime(590): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.JLaird.blogreader/com.JLaird.blogreader.BlogWebViewActivity}: android.view.InflateException: Binary XML file line #9: Error inflating class android.webkit.WebView```

I hope this is something I can fix and not another difference between today's Android tools and last year's when the class was recorded.

Michael Ikhane
Michael Ikhane
2,390 Points

Hi Joey,

Could you paste the log beyond the last line "ComponentInfo...". There should be line number in BlogWebViewActivity.java that triggered the error.

I suspect an error in the xml layout file for that activity.

Hi Michael,

Here is the rest. Just an FYI the app works fine when I test on my phone so this isn't a major problem but if by any chance you have any idea based on the additional information below it would be good to know. Thanks.

05-23 01:15:56.413: E/AndroidRuntime(599): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.JLaird.blogreader/com.JLaird.blogreader.BlogWebViewActivity}: android.view.InflateException: Binary XML file line #9: Error inflating class android.webkit.WebView

1 Answer

It seems to me based upon the information you provided which isn't much to really go off of that you didn't implement the intent/broadcast for the android operating system to return or send the data to the phone's web browser. or whatever you guys call it (you are farther than me). I suggest you go and look at your implementation of it and compare it to either the methods in the API and/or google it as this problem has most likely happened to someone else before. Then check your code and make corrections where you see fit. Perhaps it is one of those things in Android where you don't initialize an object with its constructor but instead maby it has a static method that will return an object of that class type for your variable to reference instead.