Resolving Android App Installation Error: INSTALL_CANCELED_BY_USER on Xiaomi Devices

Resolving Android App Installation Error: INSTALL_CANCELED_BY_USER on Xiaomi Devices

21 May 2024 Stephan Petzl Leave a comment Tech-Help

If you’re developing Android applications and testing on a Xiaomi device, you might encounter the INSTALL_CANCELED_BY_USER error during the installation process. This error can be particularly perplexing because it suggests that the user has cancelled the installation, which is often not the case. In this article, we’ll explore how to address this error and ensure a smooth app installation process on Xiaomi devices.

Understanding the Error

The INSTALL_CANCELED_BY_USER error is common among Xiaomi devices running MIUI, the customized Android OS version used by Xiaomi. This error occurs when the system blocks an app installation through Android Studio, even though the developer has not cancelled the action.

Step-by-Step Solution

To resolve this error, follow these steps:

  1. Go to Settings on your Xiaomi device, navigate to Permissions, and then to Install via USB. Make sure that the app you’re trying to install is not restricted here.
  2. In the Settings menu, go to Additional Settings, then Privacy, and ensure that the Unknown Sources option is enabled, allowing the installation of apps from sources other than the Play Store.
  3. Still in Additional Settings, scroll to Developer options and enable the Install via USB option. Note that you may need to sign in to your MI account to activate this option.
  4. For some Xiaomi devices, particularly those running MIUI 8 or later, you might also need to disable MIUI Optimization in the Developer options and then restart your device for the changes to take effect.

Additional Tips

  • If you are running MIUI 8 or above, signing in to your MI account might be necessary to enable certain developer options.
  • Turning off MIUI Optimization has helped many users, but remember to reboot your phone after making this change.
  • For devices with stricter security settings, you may need to ensure that both USB Debugging and Install via USB are enabled in the Developer options.

Repeato: Streamlining Your App Testing

While resolving installation errors is a critical step in app development, efficient testing is equally important. Our product, Repeato, is a no-code test automation tool for iOS and Android that streamlines the testing process. With Repeato, you can create, run, and maintain automated tests for your apps using computer vision and AI.

Repeato comes with built-in ADB (Android Debug Bridge) capabilities, allowing you to execute ADB commands through script steps. This feature can help you time and sequence ADB commands accurately, which is particularly useful when dealing with devices that require specific configurations like Xiaomi’s MIUI. By integrating testing and debugging seamlessly, Repeato can help you overcome challenges, such as the INSTALL_CANCELED_BY_USER error, efficiently.

For more information on how Repeato can assist with your app development and testing needs, visit our documentation or contact our support team.

Like this article? there’s more where that came from!