How To Fix the ERR_UNKNOWN_URL_SCHEME Error (8 Methods)

1. Check the URL: The first step to fixing the ERR_UNKNOWN_URL_SCHEME error is to check the URL you are trying to access. Make sure that the URL is correctly typed and that it is using the correct protocol (e.g. http or https).

2. Clear the Cache: Clearing the cache of your browser can help to fix the ERR_UNKNOWN_URL_SCHEME error. To do this, open your browser and go to the settings menu. Then, select the option to clear the cache and cookies.

3. Update Your Browser: If you are using an outdated version of your browser, it may be causing the ERR_UNKNOWN_URL_SCHEME error. To fix this, make sure that you are using the latest version of your browser.

4. Disable Extensions: If you have any extensions installed on your browser, they may be causing the ERR_UNKNOWN_URL_SCHEME error. To fix this, try disabling the extensions and then trying to access the URL again.

5. Reset Your Network Settings: If you are using a wireless connection, resetting your network settings can help to fix the ERR_UNKNOWN_URL_SCHEME error. To do this, open the settings menu of your router and select the option to reset the network settings.

6. Disable Firewall: If you have a firewall enabled on your computer, it may be blocking the URL you are trying to access. To fix this, try disabling the firewall and then trying to access the URL again.

7. Use a Different Browser: If you are still having trouble accessing the URL, try using a different browser. This will help to determine if the issue is with the browser or with the URL itself.

8. Contact the Website Owner: If you are still having trouble accessing the URL, contact the website owner and ask them to check the URL. They may be able to help you fix the issue.
[ad_1]

As you’re trying out your new Android app, you’ll want to test its WebView. However, you may notice an error preventing a browser page from rendering within the app. This can negatively impact your app’s User Experience (UX).

Fortunately, you can easily fix the ERR_UNKNOWN_URL_SCHEME error. On the front end, you may need to disable Chrome extensions or simply clear the cache. Alternatively, developers can disable non-standard URLs in the app’s coding.

In this post, we’ll explain what the ERR_UNKNOWN_URL_SCHEME error is and what causes it. Then, we’ll show you how to fix it on both the front and back end. Let’s get started!

What Is the ERR_UNKNOWN_URL_SCHEME Error?

To understand the ERR_UNKNOWN_URL_SCHEME error, let’s first discuss native apps. Put simply, a native application is installed onto a mobile device and designed for a specific operating system.

You can find native apps in the App Store or Google Play Store:

A screenshot of the Google Play Store
Google Play Store

Currently, Android controls 72% of the mobile operating system market. For this reason, you may want to develop your native app for the Google Play Store. To do this, you’ll use Android Studio, which is Android’s Integrated Development Environment (IDE):

Android Studio website
Android Studio

As you’re developing your app, it’s important to enable users to view embedded web browser content. Users who don’t have to navigate back and forth from a browser to your app will have a more consistent UX.

To add this feature to your app, you’ll use WebView. This special class displays web pages directly from a native app. Although the browser won’t have extensive features like a search bar or navigation controls, WebView will successfully render a web page.

However, your native app could also produce an ERR_UNKNOWN_URL_SCHEME error. In this case, the requested website has a URL scheme that the mobile device cannot recognize.

The ERR_UNKNOWN_URL_SCHEME is commonly a Chromium bug. It has been a prominent issue since Chrome 40. However, it can have a few different causes.

What Causes the ERR_UNKOWN_URL_SCHEME Error?

Although WebView can be useful in native apps, it’s only equipped to process a few different URL schemes. A URL scheme provides information about how the URL should be interpreted.

The standard URL schemes are ‘https://’ and ‘http://’. Here are some URL schemes that may cause the ERR_UNKNOWN_URL_SCHEME:

  • mailto://
  • whatsapp://
  • file://
  • telnet://
  • intent://
  • market://
  • app://
  • mail://
  • buy://

If you’re an app developer, you’ll need to use specific URL coding to prevent these URL schemes from causing errors. Otherwise, users won’t be able to use WebView in your native app.

Alternatively, the ERR_UNKNOWN_URL_SCHEME error can occur when a user tries to open a redirected URL. You may also see this message after using OAuth with a custom Chrome card.

How To Fix the ERR_UNKOWN_URL_SCHEME Error (8 Methods)

For developers, the ERR_UNKNOWN_URL_SCHEME error means that your app’s WebView isn’t effectively displaying web browser pages. This will prevent users from seeing the right content.

Whether you’re a developer or a front-end user, there are a few ways to troubleshoot the issue. Here are eight fixes!

1. Disable Chrome Extensions

Many Chrome errors can be resolved by troubleshooting your browser extensions. To do this, head to More Tools > Extensions. Alternatively, you can simply search for “chrome://extensions/”:

Open Chrome extensions
Open Chrome extensions

On this page, you’ll see a list of your installed Chrome extensions. First, disable all of them using the switch in the bottom right-hand corner:

Disable Chrome extensions
Disable Chrome extensions

Then, check to see if the issue was resolved. If it was, you’ll know there was a problem with one of the extensions.

To figure out which extension was causing the ERR_UNKNOWN_URL_SCHEME error, reactivate them one by one. After you turn an extension on, see if the issue reappears. When it does, remove that extension completely.

2. Clear the Chrome Cache and Cookies

As you browse the Internet, your browser will save data from websites into a cache. This will ensure that your second visit processes much faster. However, this cached data can easily become corrupted.

If the first solution didn’t resolve the ERR_UNKNOWN_URL_SCHEME error, you might need to clear your browser cache. In Google Chrome, go to More Tools > Clear Browsing Data:

Open browsing data
Open browsing data

Then, be sure to select Cached images and files. If you’d like, you can also clear your browsing history, cookies, and other saved site data:

Clear Chrome cache
Clear Chrome cache

After this, try to reload the page you were trying to reach. If it renders without an error, you’ve fixed the problem!

3. Turn Off Hardware Acceleration

Hardware acceleration happens when a browser uses your device’s hardware to increase efficiency. In Google Chrome, your device’s Graphical Processing Unit (GPU) will start processing tasks with heavy graphics, like gaming or playing videos.

Most of the time, hardware acceleration enables Chrome to perform more complex tasks than its software can support. However, this feature can also cause lagging, freezing, and even crashes.

Therefore, you may want to disable hardware acceleration. First, open Chrome’s Settings page. Then, click on the System tab:

Disable hardware acceleration in Chrome
Disable hardware acceleration

Lastly, use the toggle switch to turn off hardware acceleration. You’ll be prompted to relaunch Chrome with this new setting.

4. Disable Your Firewall

Another reason for the ERR_UNKNOWN_URL_SCHEME error is an incorrectly configured firewall. To see if this is the case, you can temporarily disable the firewall on your device.

For Mac users, click on the apple icon. Then, select System Settings:

System settings for Mac
Mac System Settings

From the list of tabs, hit Network. Next, find the Firewall option and toggle it off:

Disable Mac firewall
Disable Mac firewall

If you have a Windows computer, click on Start and open Settings. Then, navigate to Privacy & Security > Windows security > Firewall & network protection:

Firewall and network protection settings in Windows.
Firewall and network protection settings nn Windows

Now you’ll need to select either the Domain network, Private network, or Public network. Once you do this, find the Microsoft Defender Firewall setting and toggle it off:

Turning off the Microsoft Defender Firewall
Turning off the Microsoft Defender Firewall

You will see a security popup asking you to confirm your choice. Click on OK to save the change.

5. Create a New Chrome User Profile

If the previous methods didn’t solve the ERR_UNKNOWN_URL_SCHEME error, you could try creating a completely new Chrome user profile. Then, see if you can visit the page without any problems.

Fortunately, Google Chrome makes it easy to customize your profiles. In the upper right corner, click on your profile picture. At the bottom of the pop-up, hit Add:

Create a new Chrome profile
Create a new Chrome profile

This will allow you to set up a new profile. You can either sign in to an existing Chrome account or hit Continue without an account:

Set up a profile in Chrome
Set up Chrome profile

Before you start browsing, give the profile a name. Additionally, you might customize the color scheme:

You can easily customize your chrome profile
Customize Chrome profile

After this, you’ll have a new Chrome profile independent of your other accounts. While using this profile, try loading the target web page. If the issue persists, it’s a good idea to contact the app developer, who will solve the problem for you.

6. Open the URL In a New Window

So far, we’ve explained how users can potentially resolve the ERR_UNKNOWN_URL_SCHEME error in a browser. If you’re a developer, you’ll need to know how to troubleshoot this problem so your app will have an error-free WebView.

An easy fix involves editing your URL href code. By including a target attribute in your app’s HTML, you’ll specify how the browser should be opened.

For example, you can add the HTML code target=”_blank”. This will open the WebView in a new window. Here’s an example:

<a href=”https://www.w3schools.com” target=”_blank”>Visit W3Schools</a>

Although this may be an effective short-term solution, it can negatively impact your app’s User Experience (UX). In web development, it’s a good idea to avoid opening new windows.

The code snippet above will remove the Back button, which could confuse users when they want to return to the previous page.

7. Add a New Intent

As an Android developer, you’ll need to use intents. Essentially, an intent describes the action you want the app to perform. If you need to fix a URL scheme error, you could consider including an intent for the content to load in an external app.

For example, you might want the ‘maps://’ URL scheme to open a user’s default maps application. Alternatively, ‘mailto://’ can open the mail app.

To add a new intent, you’ll use an IF statement. This will tell the device to open special schemes in a relevant external app. However, standard URL schemes like ‘https://’ or ‘http://’ will open normally.

Here’s how this intent would look in action:

@Override

public boolean shouldOverrideUrlLoading(WebView view, String url) {

if (url == null || url.startsWith("http://") || url.startsWith("https://")) {

return false;

}

try {

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));

view.getContext().startActivity(intent);

return true;

} catch (Exception e) {

Log.i(TAG, "shouldOverrideUrlLoading Exception:" + e);

return true;

}

}

However, you can add a custom intent for specific external apps. If you want to send users to their installed Whatsapp, here’s how the URL override could change:

@Override

public boolean shouldOverrideUrlLoading(WebView view, String url) {

view.loadUrl(url);

if (url.startsWith("whatsapp://")) {

webview.stopLoading();

try {

Intent whatsappIntent = new Intent(Intent.ACTION_SEND);

whatsappIntent.setType("text/plain");

whatsappIntent.setPackage("com.whatsapp");

whatsappIntent.putExtra(Intent.EXTRA_TEXT, webview.getUrl() + " - Shared from webview ");

startActivity(whatsappIntent);

} catch (android.content.ActivityNotFoundException ex) {

String MakeShortText = "Whatsapp has not been installed";

Toast.makeText(WebactivityTab1.this, MakeShortText, Toast.LENGTH_SHORT).show();

}

};

};

This code will enable your app to open Whatsapp on a user’s device. If it isn’t installed, there will be a toast message telling users that “Whatsapp has not been installed.”

8. Disable Non-Standard URL Schemes

Instead of using intents, you can also completely disable non-standard URL schemes. This will prevent you from using any URL schemes apart from ‘http://’ and ‘https://’.

Here’s how to implement this in HTML:

@Override

public boolean shouldOverrideUrlLoading(WebView view, String url) {

view.loadUrl(url);

if (url.startsWith("http") || url.startsWith("https")) {

return true;

}else {

webview.stopLoading();

webview.goBack();

Toast.makeText(MainActivity.this, "Error: Unknown link type", Toast.LENGTH_SHORT).show();

}

return false;

}

If a user clicks on a link that uses a custom scheme, a toast message will display a message that says “Error: Unknown link type”. Since your app’s WebView won’t support custom schemes, you can completely avoid the ERR_UNKNOWN_URL_SCHEME error.

Summary

When people use your native app, they’ll want external links to open within the same application. If the requested website doesn’t have a known URL scheme, the user’s mobile device will return an ERR_UNKNOWN_URL_SCHEME error.

On the front end, you can troubleshoot this problem in Chrome browsers by turning off hardware acceleration or creating an entirely new user profile. However, in most cases, the app’s developer will need to resolve this error. As the developer, you’ll be able to fix the ERR_UNKNOWN_URL_SCHEME error by adding a new intent or opening the URL in a new window.

As you’re developing your app, you’ll need reliable and stable hosting. Our application hosting has 25 data centers and 24/7 expert chat support, so you can focus solely on development!


Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard
  • 24/7 expert support
  • The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
  • An enterprise-level Cloudflare integration for speed and security
  • Global audience reach with up to 35 data centers and 275 PoPs worldwide

Get started with a free trial of our Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.

[ad_2]

Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Jassweb.com/

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.

GSTIN is 03EGRPS4248R1ZD.

Contact
Jassweb, Rai Chak, Punjab, India. 143518
Item added to cart.
0 items - 0.00