Installation failed due to: 'null' - Android Studio 3.5
Solution 1
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
Solution 2
You need disable "Use libusb backend" in preferences--> debugger
Solution 3
This issue in Android Studio happens for devices lower then API 26
(Android 8). This is caused by replacement of InstantRun
, known now as ApplyChanges.
Seems to be there are only two ways before they fix it in the next update.
- Run on
API>=26
. - After every change in code edit
run configuration
changingdeploy
fromAPK
toApp bundle
and vise-versa. If I correctly understand, this will correctly rebuild app and workaround bug.
Of course, there is an option to manually delete app from device before running app from AndroidStudio.
Solution 4
Build > Clean project its work's for me. Before change other setting try this first.
Happy coding :)
Solution 5
For me either uninstalling the app or cleaning project "solves" the problem. To make it less frustrating I added clean job to debug build type like so:
buildTypes {
...
debug {
clean
}
...
}
Taseer
👹 The Satanist 👹 Kotlin > Go > TypeScript > Java > JavaScript
Updated on December 22, 2021Comments
-
Taseer over 2 years
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.
-
adek111 almost 5 yearsI have an Android 9.0 device and have this problem. However, when I mix running tests between emulator and then real device, app and tests appear to be running quite often. I don't really know why but maybe it will help someone.
-
mohax almost 5 yearsMaybe you can successfully rerun app on
API26+
if you clickApply changes
, instead ofrerun
? This is new button to right ofrerun
. -
Taseer almost 5 yearsI have changed OS to Linux and AS 3.5 is working fine there.
-
Admin almost 5 yearsThis flags means
adb install -r -t apkpath
,I guess.@TaseerAhmad -
duckbrain almost 5 years
-r
means "replace existing application".-t
means "allow test packages" -
0101100101 almost 5 yearsWhere did this man come from and how did he think of this solution? Give him a medal!
-
Syed Arsalan Kazmi almost 5 yearsNot working for me! :( Please look at my problem. Its a little different than yours. stackoverflow.com/questions/57770464/…
-
Yogesh Umesh Vaity almost 5 yearsIt's working for app install but not for tests. When I try to run androidTest.
-
Taseer almost 5 yearsWe have to wait for a 'stable' 3.6 release.
-
Beatrice Lin almost 5 yearsThe setting is Run > Edit Configurations, if windows version.
-
Raskilas over 4 yearsOnly this solution helped - Xubuntu 18.04
-
Minasie Shibeshi over 4 yearsThat was just amazing
-
Kebab Krabby over 4 yearsCant believe this worked! Android Studio 3.5.1 Android Debug Bridge version 1.0.41 Version 29.0.5-5949299
-
srisindhu saride over 4 yearsWorks like charm. Struggled with this problem for months and only this answer worked for me
-
Polycarp Kavoo over 4 yearsWorks like charm
-
Ryan Barrett over 4 yearsthank you so much for this tidbit - I was having to remove my app before each debugging session after upgrading Android-Studio ... now it works on it's own!
-
CoolMind over 4 yearsI uninstalled the app from API 29 emulator and it helped.
-
Zoe stands with Ukraine almost 4 yearsDO NOT USE THIS! Aapt has been deprecated in favor of aapt2, and will eventually be removed. This workaround will stop working, and cause other problems when aapt is removed
-
Vivek almost 4 yearsOMG! this has solved a big big problem. Struggled with this problem for months as wel.. Wow!
-
Chris.Jenkins over 3 yearsFixed this for me on OSx 10.15! Thank you!
-
Gulnaz Ghanchi over 2 yearsIt does not work for me
-
TimWeb over 2 yearsThis helped me. Thanks)