Whether you’re an app developer or a user, you might find the ERR_UNKNOWN_URL_SCHEME error while testing the app’s WebView (we’ll dive into more details about this later in this tutorial).
This error typically occurs when the app tries to open a link with an unusual, unsupported, or unknown URL scheme, like “mailto:” or “tel:” and doesn’t know how to handle it. If this happens, it could be because the app’s user experience (UX) may be disrupted.
Fortunately, fixing this error is usually straightforward. Developers can resolve it by adjusting the app’s code to disable non-standard URLs. On the other hand, users can often fix the issue by clearing the browser cache and disabling Chrome extensions on their devices.
In this tutorial, you will learn what the ERR_UNKNOWN_URL_SCHEME error means, why it occurs, and, most importantly, how you can fix it on the front end and back end, ensuring that your app or website runs smoothly without any interruptions. Let’s get started!
KEY TAKEAWAYS
- The ERR_UNKNOWN_URL_SCHEME error happens when a browser or app encounters an unfamiliar URL scheme.
- Disabling Chrome extensions, clearing cache and cookies, and turning off hardware acceleration can help fix the error.
- Creating a new Chrome user profile or modifying how URLs open can isolate and resolve the issue.
- Developers can add new intents in Android apps to handle specific URL schemes effectively.
- Avoiding or disabling non-standard URL schemes can prevent the error from occurring altogether.
Table of Contents
Introduction To ERR_UNKNOWN_URL_SCHEME Error
Before diving into the ERR UNKNOWN URL SCHEME, let’s understand the native apps and WebView. A native application is a software program designed to work on a particular operating system (OS) like Android or iOS.
These apps are installed directly onto mobile devices and are built to fully integrate with the device’s hardware and software, providing a smooth and responsive user experience. Native apps can access various device features such as the camera, Global Positioning System (GPS), and contacts, making them highly efficient and capable.
These native apps are widely available through digital distribution platforms, such as the App Store for iOS and Google Play Store for Android. Users can download and install these applications directly from these stores to their devices.
According to statista.com, Android is currently the dominant player in the mobile operating system market, holding a 70.71% market share. This widespread use makes it a prime platform for developers looking to create apps that reach a broad target audience.
Given Android’s market dominance, developing native apps for the Google Play Store is crucial for reaching the largest audience possible. Developers use Android Studio, the official Integrated Development Environment (IDE) for Android, to build these apps.
Android Studio provides tools for writing code, debugging, and testing apps to ensure they run smoothly on Android devices. It’s an essential resource for anyone developing apps for the Android platform.
Therefore, it’s important for apps to integrate web content seamlessly; allowing users to view web pages directly within the app enhances the visitor experience by keeping them engaged within the app environment.
When users don’t have to switch between the app and a web browser, it creates a more consistent and enjoyable experience, reducing the likelihood of frustration or confusion. This is where WebView is at work.
WebView is a special class in Android that allows developers to show web pages within their native apps. It acts like a mini browser embedded inside the app, enabling users to access online content without leaving the app.
While WebView doesn’t include all the features of a full browser—like a search bar or navigation controls—it effectively renders web pages, providing a simplified browsing experience within the app.
The ERR_UNKNOWN_URL_SCHEME error occurs when an app using WebView tries to open a link with a URL scheme that the mobile device does not recognize. This error is most common in apps that attempt to open special types of links, such as those beginning with “mailto:”.
When WebView encounters a URL scheme it doesn’t support, it fails to load the page, resulting in an ERR UNKNOWN URL SCHEME error message.
Remember: this error is often associated with a bug in Chromium, the open-source project underlying many web browsers, including Google Chrome.
The issue has been prevalent since Chrome version 40. However, the error can also occur for other reasons, such as when a developer has not configured WebView to handle certain URL schemes or if the device’s software is outdated and lacks support for newer protocols. Let’s delve into the causes of this error in detail below.
Causes Of ERR_UNKNOWN_URL_SCHEME
Now, we know that WebView is a useful tool that allows Android apps to embed web content directly within the app, providing a smooth user experience. However, the URL scheme provides all the details about how a URL should be interpreted.
By using URL schemes, WebView can open specific links directly from the app, such as those for making phone calls or sending emails. This functionality enhances the app’s capabilities and makes it more versatile.
However, some URL schemes can cause the ERR_UNKNOWN_URL_SCHEME error if the app doesn’t handle them properly. Common URL schemes that may trigger this error include:
- mailto://
- telnet://
- whatsapp://
- intent://
- mail://
- market://
- file://
- app://
- buy://
Furthermore, you may face the NET::ERR_UNKNOWN_URL_SCHEME error if you misspell the standard URL schemes “https://” and “http://”. Here’s how you can generate it in error:
- “htttp” or “httpp” instead of “http”
- “http” instead of “http://” (missing the colon and double slashes)
- “hhtps” or “hps” instead of “https”
- “https//” instead of “https://” (missing the colon after “https”)
- “htps” instead of “https”
- “httpss” instead of “https”
- “http//” instead of “http://” (missing the colon after “http”)
- “htts” instead of “https”
Developers can accidentally cause this error if they don’t configure WebView to recognize and handle these specific URL schemes. For instance, this will occur if the app is supposed to open a “mailto:” link to launch an email client, but WebView has not been set up to handle this scheme.
This error can also occur on the user side if the app or device isn’t updated to the latest version. This could cause compatibility issues with some URL schemes.
Alternatively, the ERR_UNKNOWN_URL_SCHEME error might appear when a user attempts to open a URL that has been redirected. This issue can also arise after using OAuth with a custom Chrome tab.
How Modern Browsers Show This Error?
Modern browsers are less likely to show the ERR_UNKNOWN_URL_SCHEME error than older versions. This is because modern browsers, like the latest versions of Chrome, Firefox, and Edge, have been updated to handle various URL schemes and protocols better.
These browsers include built-in mechanisms to interpret the schemes properly or redirect them to the device’s right app, service, or relevant search results. I’ve tried it on Google, and it redirected me to the search results. See the following screenshot:
Additionally, modern browsers are designed to work seamlessly with native applications and web technologies, reducing the likelihood of encountering unrecognized URL schemes. They also include improved error handling and can manage unsupported schemes more gracefully by ignoring them or providing a clearer, more informative error message.
In short, as browsers evolve and improve, they become better equipped to handle different types of URL schemes, making errors like NET::ERR_UNKNOWN_URL_SCHEME less common. However, if such an error does appear, it might be due to outdated browser versions, specific custom configurations, or rare and unsupported schemes. So, let’s dive into its solution!
How Users Can Fix ERR_UNKNOWN_URL_SCHEME Error
When you encounter the ERR_UNKNOWN_URL_SCHEME error, there are multiple ways to troubleshoot and fix the issue. Below, we’ll explore 5 effective methods to resolve this error, starting with how to deactivate or disable Chrome extensions.
Disable Chrome Extensions
Sometimes, certain Chrome extensions can interfere with how your browser handles URL schemes, leading to this error. Extensions that block ads, scripts, or certain types of content might cause the browser to misinterpret a URL scheme.
To troubleshoot, disable all your extensions and check if the error persists. Go to Chrome’s ⋮ → Extensions → Manage Extensions. Alternatively, you can go to chrome://extensions/ link. Toggle off each extension, then refresh the page to see if the issue is resolved. If the error disappears, you can enable the extensions one by one to identify the culprit.
Once you find the specific extension causing the issue, you can disable it permanently. If there is no issue with the extensions, you can re-enable them by toggling the switch back to the on position, and try the next solution.
Clear Chrome Cache & Cookies
Cache and cookies store information about websites, including WordPress websites to help them load faster, but sometimes they can cause issues. If the data stored in your cache or cookies becomes outdated or corrupted, it might prevent Chrome from correctly handling certain URL schemes, leading to the ERR_UNKNOWN_URL_SCHEME error.
To clear your cache and cookies in Google, go to ⋮ → Settings → Privacy and security. Then, click on Delete browsing data.
Make sure you’re on the Basic tab. Pick a time range. Select Cookies and other site data & Cached images and files. In some cases, clearing the Browsing history also helps. Then, click Delete data. This can help resolve the error by removing any conflicting data.
Now, check if the error is fixed; otherwise, you may need to investigate further.
Turn Off Hardware Acceleration
Hardware acceleration is a feature in computers and browsers that uses your computer’s hardware, like the Graphics Processing Unit (GPU), to perform certain tasks more efficiently than software can manage alone.
Instead of relying only on the Central Processing Unit (CPU, the brain of the PC or computer) to process everything, hardware acceleration hands over some tasks to other components, like the GPU, which is better equipped to handle graphics-intensive tasks.
Let’s understand this better by giving an example. Imagine you’re in a kitchen preparing a big meal. The CPU is like the master chef who’s responsible for cooking everything. If the chef tries to do all the chopping, mixing, and cooking alone, it will take much longer, and they may be overwhelmed.
But if the chef delegates some tasks—like chopping vegetables or stirring pots—to kitchen assistants who specialize in those jobs, the meal gets prepared faster and more efficiently.
In this analogy, the kitchen assistants are like the GPU and other hardware components that take over specific tasks, allowing the master chef (CPU) to focus on the cooking process.
Now, why do you need to turn off hardware acceleration? Sometimes, hardware acceleration can cause issues, especially if your graphics card or drivers aren’t fully compatible with the browser’s features. If you’re experiencing problems like screen flickering, crashes, or slow performance in Chrome, you might want to disable hardware acceleration to check if it resolves the issue.
Here are the steps required to disable hardware acceleration in Chrome:
Open Chrome browser on your computer. Click on the 3 vertical dots menu ( ⋮ ) in the upper-right-hand corner of the browser. Select Settings from the dropdown menu.
Scroll down to the bottom of the Chrome Settings page and click on System. In the System section, you will see an option labeled Use graphics acceleration when available. Toggle this switch to the off position.
Important: If you’re using an old version of Chrome, you may see the Use hardware acceleration when available option instead of Use graphics acceleration when available. In this case, toggle off Use hardware acceleration when available. However, we always recommend to keep your browser updated.
After disabling hardware acceleration, Chrome will prompt you to relaunch the browser. To do so, click on the Relaunch button to apply the changes.
Now, refresh the page where you were facing the NET::ERR_UNKNOWN_URL_SCHEME error and see if it’s resolved. If not, you may have firewall-related issues.
Protect your online assets with our advanced web hosting solutions.
Explore secure cPanel Web Hosting at Hosted.com.
Disable Your Firewall
A firewall is designed to protect your system from unwanted network traffic, but sometimes it can be too restrictive. It might block certain URL schemes, causing the ERR_UNKNOWN_URL_SCHEME error. This can happen if the firewall mistakenly identifies the URL as a security threat.
If you suspect your firewall is causing the ERR_UNKNOWN_URL_SCHEME error, you can temporarily disable it to check if this resolves the issue. Here’s how to do it:
Click the Start menu on your Windows PC and select Settings.
Then, go to Update & Security → Windows Security. Navigate to the Protection area section and click on Firewall & network protection.
A new window will open for you. Make sure you are on Firewall & network protection is selected. Click on either the Domain network, Public network, or Private network. In this example, we’re going with the Domain network.
Scroll down a bit and toggle off the Microsoft Defender Firewall. As soon as you toggle off, you’ll be prompted to confirm, click Yes to confirm the action.
Alternatively, you can go through the following section to deactivate firewalls for public and private networks:
Disable Firewall for Public and Private Network Settings
Important: Disabling your firewall should only be done temporarily and with caution. Firewalls provide essential protection for your computer; leaving them off can make your system vulnerable to threats. If you find the firewall is the cause of the error, you may need to adjust its settings or consult your IT support to allow the necessary connections without compromising security.
After disabling the firewall, check if the NET::ERR_UNKNOWN_URL_SCHEME is fixed. If this also doesn’t work, then you (as a user) may try the last solution below.
Create A New Chrome User Profile
This is the last method that you can try as a user to fix ERR UNKNOWN URL SCHEME. However, before going into the details, let’s understand how the Chrome user profile can cause this error and how creating a new profile will resolve this issue.
A Chrome user profile stores your browsing history, bookmarks, settings, extensions, and other personalized data. Over time, this data can accumulate, and conflicts may arise, especially if certain settings or extensions interfere with how Chrome handles URL schemes.
If your current user profile has corrupted files or conflicting extensions, it can cause the ERR_UNKNOWN_URL_SCHEME error, which means your Chrome encounters a URL scheme it doesn’t recognize or can’t process properly due to these conflicts.
If you create a new Chrome user profile, this can resolve this error. Creating a new Chrome user profile can help resolve the ERR_UNKNOWN_URL_SCHEME error by providing a fresh and default environment without any accumulated data, extensions, or settings that might be causing the issue.
A new profile starts from scratch with no pre-existing conflicts or corruptions. Here’s how to create a new Chrome user profile:
Open Google Chrome on your computer. Click on the profile icon in the top-right corner of the browser window. It’s usually a small circle with your profile picture or initials. In the dropdown menu, click on Add.
A new screen will show, allowing you to create a new Chrome user profile. You can click Continue without an account or Sign in to your current Google Chrome account.
Give this profile a name. Optionally, you can also upload an image and customize the profile. Lastly, click Done and start browsing the web.
Use this new profile to visit the domain name or link that previously caused the ERR_UNKNOWN_URL_SCHEME error. If the error doesn’t appear, the issue is probably related to the old profile’s settings or data, so you may need to adjust this. Alternatively, you can contact the app developer, who will resolve the issue.
If the error is resolved, you can use the new profile regularly. You can also transfer your bookmarks and other necessary data from the old profile – but be cautious about reinstalling extensions or importing settings that might have caused the issue.
How Developers Can Fix ERR_UNKNOWN_URL_SCHEME Error
So far, we’ve explored 5 different methods users can attempt to remove the ERR_UNKNOWN_URL_SCHEME error. If you’re an app developer, you can go through the following solutions:
Open URL In A New Window
The ERR_UNKNOWN_URL_SCHEME error often occurs when an app or website tries to open a link with a URL scheme that the browser or WebView doesn’t recognize. An app developer may resolve this issue by configuring the link to open in a new window or tab instead of trying to handle it within the existing window or app.
This method bypasses the need for the WebView or the current browser session to manage the URL scheme, allowing the external browser or a new window to handle the link appropriately. To do this, modify the link by opening it in a new window.
When coding the application or website, developers can use JavaScript or HTML attributes to adjust how the link is handled. For example, in HTML, you can use the target=”_blank” attribute in the anchor tag (also called a tag) to open the link in a new window:
<a href=”mailto:someone@example.com” target=”_blank”>Send Email</a>
The above code snippet tells the browser to open the link in a new tab, which can help avoid the NET::ERR_UNKNOWN_URL_SCHEME error.
Similarly, JavaScript developers can do this in JavaScript to ensure that some URLs open in a new window. For instance:
window.open(“mailto:someone@example.com”, “_blank”);
This script creates a new window to handle the URL, thus bypassing the limitations of the current window or WebView.
Why did you need to do this? Opening a URL in a new window helps resolve the ERR_UNKNOWN_URL_SCHEME error because it shifts the handling of the URL to the browser’s main context, which is better equipped to manage different URL schemes.
By doing so, the application or WebView doesn’t need to process the URL directly, reducing the chances of encountering an error due to unrecognized schemes.
This approach is useful especially when dealing with URL schemes that are meant to trigger specific actions, like opening an email client or initiating a phone call. By opening these links in a new window, developers ensure that the appropriate application or browser function is used to handle the request, thus improving the user experience and avoiding errors.
Add A New Intent
In Android development, an Intent is a messaging object you can utilize to request an action from another app component. Intents are important because they allow different components of your app, or even different apps, to communicate with each other. For example, if your app needs to open a webpage, make a phone call, or send an email, you can use an Intent to trigger the appropriate app or function to handle the task.
Adding Intents is important as it simplifies handling specific tasks, especially those involving actions outside of your app. Instead of writing complex code to manage these tasks, you can rely on Intents to connect your app with other apps or system functions already equipped to handle them.
This not only saves time; it also enhances your user experience by using existing apps and services. Now, you might wonder how Intents can handle URL schemes in apps.
When developing an Android app, it’s common to encounter URL schemes like “mailto:” for email or “tel:” for phone calls. Instead of trying to handle these schemes within your app, which can lead to errors like the ERR_UNKNOWN_URL_SCHEME, you can use Intents to delegate the task to the appropriate app.
For example, if your app encounters a “mailto:” link, you can create an Intent that opens the user’s email client to compose a new email. Similarly, to handle a “tel:” link, you can use an Intent to initiate a phone call. Here’s the sample code with output in a .gif format:
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
String url = request.getUrl().toString();
// Handle "mailto:" links
if (url.startsWith("mailto:")) {
Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.setData(Uri.parse(url)); // Set the mailto Uri as the data for the intent
try {
startActivity(emailIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(view.getContext(), "No email client found.", Toast.LENGTH_SHORT).show();
}
return true;
}
// Handle "tel:" links
if (url.startsWith("tel:")) {
Intent phoneIntent = new Intent(Intent.ACTION_DIAL);
phoneIntent.setData(Uri.parse(url)); // Set the tel Uri as the data for the intent
try {
startActivity(phoneIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(view.getContext(), "No phone client found.", Toast.LENGTH_SHORT).show();
}
return true;
}
// Return false to let WebView handle other URLs by default
return false;
}
To create a new Intent, you need to use an if statement. Remember that the standard URLs (“https” and “http”) are handled normally. However, you can handle them as well if you want to. For example, you can write code for the standard URLs as follows:
// Handle HTTP and HTTPS links normally within the WebView
if (url == null || url.startsWith("http://") || url.startsWith("https://")) {
return false; // Let the WebView handle the URL
}
Furthermore, you can also create a custom Intent. For this tutorial, we’re creating a custom intent for WhatsApp:
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) {
Toast.makeText(view.getContext(), "Whatsapp has not been installed", Toast.LENGTH_SHORT).show();
}
}
Important: For this tutorial, because we used API 24 method, we override shouldOverrideUrlLoading(WebView view, WebResourceRequest request). If you’re using an older API, then you can override shouldOverrideUrlLoading(WebView view, String url) method.
Disable Non-Standard URL Schemes
This is the last solution that a developer can try. Non-standard URL schemes are custom protocols that aren’t recognized by all browsers or apps. While disabling them can prevent certain errors, it can also cause the ERR_UNKNOWN_URL_SCHEME error if your app or site relies on these schemes.
To avoid this error, disable non-standard URL schemes if you don’t use them in your app or in the website’s code. Stick to standard schemes like “http://” and “https://” to ensure compatibility and reduce the chance of triggering this error.
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
String url = request.getUrl().toString();
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;
}
In this way, the user will be prompted with an error saying unknown link type.
To improve your application’s uptime, choose a good hosting provider that values your time, effort, and money.
FAQs
What causes the ERR_UNKNOWN_URL_SCHEME error?
This error occurs when a browser or app encounters a URL scheme it doesn’t recognize, like “mailto://” or “intent://”.
Can Chrome extensions cause this error?
Yes, certain extensions can interfere with how Chrome handles URL schemes, leading to this error.
How do I clear Chrome’s cache and cookies?
Press Ctrl + Shift + Del, select the options for cookies and cache, then click Delete data.
What is hardware acceleration in Chrome?
Hardware acceleration uses your computer’s GPU to speed up tasks. Turning it off can help resolve this error.
How do I create a new Chrome user profile?
Click your profile icon in Chrome, select Add, and follow the prompts to set up a new profile.
Why should I open URLs in a new window?
Opening URLs in a new window can avoid conflicts that might trigger this error.
What is an Intent in Android development?
An Intent is a message that allows different parts of an app to communicate, helping to handle specific URL schemes.
How can I disable non-standard URL schemes?
Avoid using non-standard schemes like “intent://” in your code, sticking to standard schemes like “http://” and “https://”.
Is it safe to disable my firewall temporarily?
Yes, but remember to turn it back on after testing, as the firewall protects your system from threats.
Can this error occur on mobile devices?
Yes, especially in apps using WebView that encounter non-standard URL schemes.
Other Related Tutorials & Blogs:
– How To Fix ERR_TUNNEL_CONNECTION_FAILED Error
– How To Fix SSL_ERROR_NO_CYPHER_OVERLAP Error
– How To Fix ERR_INTERNET_DISCONNECTED Error
– How To Fix ERR_BAD_SSL_CLIENT_AUTH_CERT Error
– How To Fix ERR_FILE_NOT_FOUND Error In Google Chrome
- About the Author
- Latest Posts
Wayne Diamond, the founder and CEO of Hosted.com, has over 20 years of expertise in the domain name and website hosting industry.
Under his leadership, Hosted.com will work towards transforming the way SMEs, entrepreneurs, freelancers, and established enterprises of all sizes manage their domain names, website and WordPress hosting, and online presence.