30

I am trying to run my app on a real Android device on Android Studio v3.5. It throws the following error while installing the app.

> Installation did not succeed.  
> The application could not be installed.  
> Installation failed due to: 'null'
3
  • 1
    Check this please : stackoverflow.com/questions/57589248/installation-failed-due-to-null-android-studio-3-5
    – Filip123go
    Sep 3, 2019 at 11:12
  • Its a different case. I have tried this. It does not work Sep 3, 2019 at 11:26
  • What's the Android version? Have you tried applying other answers?
    – Taseer
    Sep 5, 2019 at 9:07

28 Answers 28

44

I had the Same issue on a MAC, this is how I solve it, note: I was tried the method that mention @Manoj Kumar,

Un check this field in Preferences/Build,Execution,Deployment/Debugger

5
  • 8
    there is no such a thing in my settings! though when i am searching libusb it tracks exactly to this location! what should i do?
    – Reflection
    Jan 17, 2020 at 11:21
  • How about an emulator? I'm using Memuplay
    – user3763113
    Apr 22, 2020 at 16:18
  • In my case, the option was unchecked, and succeed after checking it.
    – CHAN
    May 27, 2020 at 9:30
  • 6
    This option no more available in latest android studio Jan 11, 2021 at 9:38
  • It works in my Android Studio Hedgehog | 2023.1.1 Canary 3
    – Viroth
    May 13 at 5:17
26

Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present.

 <activity android:name=".MainActivity"
           android:exported="true">
      <intent-filter>
          <action android:name="android.intent.action.MAIN" />
           <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
 </activity>
2
  • This works for me, and I can rate it as the best answer here. Thanks @basavaraj
    – Ephra
    Feb 14 at 18:57
  • This works for me.... Sep 5 at 7:45
20

1.Open run/debug configuration dialog:- Run> edit configurations.

  1. Navigate to You app > General > Installation Options > Install Flags.
  2. add install flags -r -t.

Note: This flags means adb install -r -t apk path

enter image description here

I hope this will help.

4
  • 4
    Its a different case. I have tried this. It does not work Sep 3, 2019 at 11:28
  • so are you running this application in an emulator or in a real device? Sep 3, 2019 at 11:32
  • Real Device: Xiaomi Redmi S2. Sep 3, 2019 at 11:33
  • Any idea with this error? Installation failed due to: ''cmd package install-create -r -t --user current --full --dont-kill -r -t --skip-verification -S 11805591' returns error 'Unknown failure: cmd: Can't find service: package''
    – HY2000
    Sep 7, 2022 at 11:42
11

For me, restarting the Android Studio solved the issue.

File> Invalidate Cache / Restart

1
  • This worked for me when apps wouldn't install using wireless debugging. Oct 22, 2021 at 18:23
6

Restarting the device after enabling developer mode and allowing usb debugging did the trick for me.

5

When you connect the mobile, it starts in the charging mode. Simply change the mode to Transfer Mode (Transfer Media or photos mode).

Now install the app again and it will work.

2
  • 1
    OH MY GOD!!! I spend multiple hours trying to fix this, toggling usb debugging, developer options, resetting authorizations, data and even factory resetting the device... Why isn't this switched automatically when you enable USB debugging???
    – AXE
    Mar 20 at 17:25
  • The libusb backend check option didn't help on Linux as suggested by another user. So unchecked, restarted PC. Then on the phone Selected USB Tethering on 'Developer Options' > 'Default USB configuration'. This is with Android Studio Giraffe. Aug 19 at 11:17
4
  1. You has installed the app which has same package name with different debug signature file.
  2. The different signature file lead to the fault
  3. At first please uninstall the apk that you has installed with different signature file。
  4. Then you install the apk again ,You'll sucess!
0
4

It may be because of your phone's memory is full. you can delete some data from your phone and then try. for me it worked.

1
  • yepp, my case. Have uninstalled some apps and now it plays ok again
    – CodeToLife
    Jun 4, 2022 at 11:09
2

Tip: run from terminal adb install path/to/app.apk

Why? Cause it will give more information about the error - actually pointing to the place in manifest with the error. For example - in my case it was: 'Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]'

1
  • Thanks a lot, this indeed led to an easy fix of the problem. The whole command with the default path where the auto-generated apks are stored is then as follows: adb install app\build\outputs\apk\debug\app-debug.apk
    – BenjyTec
    Jan 21, 2022 at 12:17
1

A simple (unintended) restart to the computer did it for me (I tried to run on emulator)

1

In my case I was using third party library, I have removed that library from gradle and reinstall the app. Successful

1

Add this line to your '/gradle.properties':

# gradle.properties
android.injected.testOnly=false

Check https://gist.github.com/xujiaao/5fd127a72979cdc3c70dcc1324786f87 ,it work for me.

1

Just use in this link. Disable Preference -> Build,Execution,Deployment -> Debugger -> Use libusb backend

Uncheck Use libusb backend

that's all. Enjoy your coding...

0

Chech to manifest file and search for a required library tag. And delete it. I solve it by this way.

0

I was trying everything but nothing seemed to work. But then I suddenly noticed that my phone blocked installation, so I unchecked "reject this to install" and at the another try the security checkbox popup, asking for letting the installation. After allowing everything worked. Conclusion: I just were probably too angry that i didn't noticed this popup earlier.

0

Just check in the AndroidManifest.xml file to make sure you are using permission and libraries that you need for your app. In some cases you may have wearable libraries and permissions in your AndroidManifest.xml file and yet you do not need them. This happened to me when I was adding more activities and Android Studio was creating them as Wearable Activities

0

I'm trying every thing from the answers but only one solution is just free some space on your phone for proper install the debagged app.

2
  • This recommendation was already provided. Instead of creating a duplicate answer, it's better to add a comment on the original answer, or simply up-vote it.
    – Bafsky
    May 9, 2021 at 17:13
  • Or you can upvote an existing answer if it is the same as yours. May 10, 2021 at 8:28
0

For me ı had this problem i fixed it because i did not use Android studio Emulator i was using another one i fixed the problem when I enabled Developer Mode from Emulator and that is all for
I hope that can help some one like me
Regards

2
  • The question mentions that it's related to a real device not an emulator. Please read through the question thoroughly before answering.
    – Boris
    May 31, 2021 at 22:02
  • Ok no problem dear my answer also can help someone. Regards Jun 17, 2021 at 18:53
0

I had this problem at one point in time. the only solution that worked for me was to delete the SDK and download a new vision. It turned out that ADB had a problem and it was not able to detect my device. uninstalling the SDK and installing another resolved the problem for me

0

As I am currently using IntelliJ IDEA 2021, In order to work for me, I had to disconnect android device(Emulator) to Computer by USB and Free up some space on phone storage Lastly It was to refresh my device by restarting it(phone)

Again, I had to go to:

Settings, Debugger, And Check Hide debug Window on process termination

I hope this helps, if U are using IntelliJ IDEA, for instance.

0

Create a signed apk and drag that apk to the emulated device, that worked for me

0

You might wana check your phone storage too. Your apk wouldn't install if there is no space

1
  • 1
    This has already been mentioned in several other answers. When answering older questions that already have answers, please make sure you provide either a novel solution or a significantly better explanation than existing answers.
    – Eric Aya
    Oct 3, 2021 at 11:26
0

I resolved the problem by switching off the emulator, clean the project and rebuild it again.

0

Its because the devie on which you want to install the app does not have enough space, just clear some items to get space. Then try agian

1
0

go to the path of your debug apk, and rename of your apk like :

myApp.apk to myApp1.apk(just rename it) and try to run it again.

its works for me every time :)

0

TRY THIS!

  • Delete the build folder in your App and re-build the project, it should work now.
0

Accept agreement of terms and conditions by opening Google Maps and Google Chrome on a newly created emulator, your application might be using Google play or location services.

0

I was faced this same error while running application. I am just rebuild the program and run again the application..

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.