Android – Installation failed due to: ‘null’ – Android Studio 3.5

androidandroid-studio

I have updated Android studio to 3.5, ever since I am running into an APK installation problem. This is the only log it shows:

Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION
Installation failed due to: 'null'
Retry

This happens when trying to install APK on a real device. If I uninstall the app from the device and then rerun the build, it installs only one time and then it keeps throwing this error on the next installation. It runs fine on an emulator but I can not use an emulator for everything.

What I have tried:

  • Deleted Android Studio configuration file.
  • Deleted Gradle files from the project.
  • Invalidated and reset caches.
  • Cleaned/rebuilt the project.
  • Looked for similar problems Stackoverflow(nothing matches my problem)
  • Clean installed(Removed all files including SDKs) Android Studio 3.5

Update

I installed Linux Mint on my machine and tested the AS 3.5 there, for some reason everything is working fine even for Android 7 and below devices.

Previous OS: Windows 10 1903

Current OS: Linux Mint 19.2

I reckon this problem may be originating from Windows machines.

Best Answer

Open Run/Debug Configuration dialog (Windows: Run > Edit Configurations)

edit You app > General > Installation Options > Install Flags .

add install flags -r -t.

This flags means adb install -r -t apkpath

screen pic