How to Fix: LSOpenURLsWithRole() failed with error -128
Error -128 occurs when opening ML files on OS X. Possible causes include outdated LaunchServices.plist file or unsupported file types.
📋 Table of Contents
The error 'LSOpenURLsWithRole() failed with error -128' occurs when trying to open a file on OS X using the `open` command. This issue affects users who have added support for opening files with no extensions in their LaunchServices settings.
This error can be frustrating, especially when working with files that require specific permissions or roles. In this guide, we will walk you through the steps to resolve this issue and regain access to your files.
🔍 Why This Happens
- The primary reason for this error is a mismatch between the file type association and the role set in the LaunchServices settings. When you added support for opening files with no extensions, it may have caused conflicts with other applications or roles.
- Another possible cause is an outdated or corrupted LaunchServices.plist file. Although deleting this file resolved the issue initially, its reappearance could be due to various factors such as a system update or a misconfigured settings.
🔧 Proven Troubleshooting Steps
Resolving the Issue by Updating LaunchServices Settings
- Step 1: Open the LaunchServices.plist file in a text editor and navigate to the 'LSHandlers' section. Ensure that the handler for your ML file type is correctly configured with the correct role set.
- Step 2: Check the 'Role' column to ensure it matches the expected value (e.g., 'public.app-leaf'). If the value does not match, update it accordingly.
- Step 3: Save the changes to the LaunchServices.plist file and restart your system. This should resolve the issue and allow you to open your ML files without errors.
Alternative Fix: Reconfiguring File Associations
- Step 1: Open the 'File Types' preferences in System Preferences. Select your ML file type from the list and click on the 'Edit' button.
- Step 2: In the 'Open with:' field, select the application you want to use to open ML files (e.g., Sublime Text 2). Click 'Choose' to confirm the changes.
- Step 3: Save the changes and restart your system. This should update the file association correctly and resolve the issue.
🎯 Final Words
By following these steps, you should be able to resolve the 'LSOpenURLsWithRole() failed with error -128' issue and regain access to your ML files. If you continue to experience problems, consider resetting LaunchServices settings or seeking further assistance from Apple Support.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid