简体   繁体   中英

Android Studio Error "Installation did not succeed. The application could not be installed. Installation failed due to: 'null'"

I am trying to run my app on my Xiaomi RedMi S2 from Android Studio 3.5. It throws an error while installing the app on the phone:

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

REAL DEVICE: XIAOMI REDMI S2

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

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

在此处输入图片说明

I hope this will help.

在启用开发人员模式并允许 USB 调试后重新启动设备对我来说很有效。

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.

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. 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!

对计算机的简单(意外)重新启动为我做到了(我尝试在模拟器上运行)

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

# gradle.properties
android.injected.testOnly=false

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

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

Uncheck Use libusb backend

that's all. Enjoy your coding...

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

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

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.

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

我正在尝试答案中的每一件事,但只有一种解决方案只是在手机上释放一些空间以正确安装 debagged 应用程序。

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

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.

创建一个签名的 apk 并将该 apk 拖动到模拟设备,这对我有用

For me, restarting the Android Studio solved the issue.

File> Invalidate Cache / Restart

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]'

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>

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:)

TRY THIS!

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

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.

i was faced this same error i am just rebuild the program and run again the application..

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

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM