Problem description
When the app was uninstalled last time, the native program in the app was not killed but occupied the /data/data/{packageName} directory. The app-related content in the /data/data/ directory was not deleted. In most cases, the following log entry can be found in logcat: Installer: rm -rf failed, directory is not empty. The remaining content cannot be overwritten at the next installation and this exception occurs.
Solution
If the root permissions are enabled on the device, you can directly delete the package name folder in the /data/data/ directory. Otherwise, you must restore factory settings of the device. In addition, developers must pay extra attention to devices that are prone to this exception and inform users of this exception. EMAS can solve it without user intervention.