Verified Fix

How to Fix macOS Error LSApplicationQueriesSchemes

If you are encountering error LSApplicationQueriesSchemes on macOS, this guide will help you resolve it.

Quick Summary

The 'LSApplicationQueriesSchemes' error arises when an iOS/macOS app attempts to check for the availability of other apps via URL schemes not explicitly declared in its Info.plist. This is a privacy and security measure implemented by Apple to prevent apps from indiscriminately querying the user's installed app list.

Common Causes

  • Missing URL Schemes Declaration: The app is trying to use `canOpenURL:` to check for the presence of an app using a custom URL scheme (e.g., 'myapp://') that is not listed in the 'LSApplicationQueriesSchemes' array in the app's Info.plist file.
  • Incorrect URL Scheme Name: The URL scheme name in the code does not accurately match the scheme registered by the target application. Even a small discrepancy will trigger this error.
  • Schemes Not Whitelisted: The app is trying to determine if another app is installed, but it hasn't declared the schemes it intends to query. This can occur when using third-party libraries or SDKs that require specific schemes to be whitelisted for their functionality.

Step-by-Step Fixes

Method 1: Add URL Schemes to 'LSApplicationQueriesSchemes' in Info.plist

Step 1: Open your project in Xcode.

Step 2: Open the Info.plist file.

Step 3: Add a new key called 'LSApplicationQueriesSchemes'.

Step 4: The value of 'LSApplicationQueriesSchemes' should be an array. Add each URL scheme that your app will check for to this array as a string. For example, if your app needs to check for 'twitter://' and 'facebook://', add both as string elements in the array.

Step 5: Save the Info.plist file and rebuild your app.

Method 2: Verify URL Scheme Names

Step 1: Double-check the spelling of the URL schemes you are using in your code and ensure they exactly match the URL schemes registered by the target apps. Pay attention to capitalization and any special characters.

Step 2: Inspect the Info.plist of the target application (if you have access) to verify the registered URL scheme.

Step 3: Update your 'LSApplicationQueriesSchemes' array in your app's Info.plist with the corrected names.

Method 3: Address Third-Party SDK Requirements

Step 1: If the schemes are required by a third-party library or SDK, consult the SDK's documentation for a list of required schemes.

Step 2: Add all required URL schemes to the 'LSApplicationQueriesSchemes' array in your app's Info.plist.

Step 3: Clean and rebuild your project after adding the required schemes.

Download Repair Tool →