Trying to install app on real device following instructions:- http://developer.android.com/tools/device.html. At end Android Studio giving error:
Session 'app': Error Installing APK
I guess the problem probably can be in my android device(it is chinese Doogee X5). It does not have a given USB Vendor ID in developer docs so I decided to follow instructions with random vendor ID from HTC.
I'm sure there is a way to run application on any android device, but yet I didn't find an answer on how to do that.
I'm running through Linux Ubuntu 14.04 LTS
This question is related to
android
android-studio
installation
apk
adb
You have to enable Developer options and enable USB Debugging:
http://www.androidcentral.com/how-enable-developer-settings-android-42
Inside Developer Options
, enable USB Debugging
Uninstall the app, and re-install and it should work!
This happens because the gradle is not synced with the app. Go to : Tools -> Android -> Sync Project with Gradle files. Re-run and you should be good to go.
I fixed my issue, simply by using :
Build->Clean Project
then
Build->Rebuild Project
What worked for me is deleting the app from the emulator (which was an app built from an older commit) and re-running from Android Studio.
I changed my USB port and that fixed it for me.
Ensure you android device has enough memory to install the app. Sometimes it so happens working with multimedia app where the device storage keeps on increasing and you keep wondering about the error.
Therefore, free up some memory and try installing again!
Just rebuild and clean project, then run project.
My problem was that I didn't accept the connection from the computer after turning on remote debugging. Once I accept the mac address, it went away. Silly mistake, but I didn't see the dialog box the first time. Worth a quick check if the others don't resolve the issue. But likely only a problem the first time you set up a phone.
Try using a different version of Gradle(stable version). To summarize:
Another possibility may be the USB driver on your PC. In my case, switching from my 3.0 USB port to my 2.0 port fixed the problem.
My issue was solved by Clean --> ReBuild --> Run and in my case it was because i accidentally deleted the project folder and when i clicked ctrl+z to restore something wrong happened.
Nothing above helped me. The fingerprint dialog did not appear. I checked another android device and the dialog appeared and debug was possible. So the problem was on device side not on computer side I made reset "to factory settings" on device and this helped me.
Try to remove the .idea
folder and .gradle
folder, then click Sync Project with Gradle Files
, when the process finished, try to run app again.
Hope it works.
I tried invalidating cache, deleting build folder and gradle sync. Also, I couldn't uninstall because the app is not visible on device. So I tried uninstalling through ADB and it worked.
adb uninstall <package_name>
just press Build button from menu bar and then press build app wait for it finished then press build APK and then run your emulator, it will work
If you are using android emulator, try changing a device.
Make sure that project name doesn't contain special character.
Make sure that your device is not out of Memory!
You have to enable Developer options and enable USB Debugging:
1:Go to the settings menu, and scroll down to "About phone." Tap it. 2:Scroll down to the bottom again, where you see "Build number." (Your build number may vary from ours here.) Tap it seven (7) times. After the third tap, you'll see a playful dialog that says you're four taps away from being a developer. Keep on tapping, and poof, you've got the developer settings back.
A bit late to the party, but be sure that you are trying to build a proper build variant. It sometimes happens to me that when I update AS, the build variants are totally messed up, so instead of building the "debug" variant I am actually building the "release" variant, which outputs apk to a different location (not to app/build directory, but to app directly) and I get the following error:
The APK file /path/to/file/app.apk does not exist on disk.
Error while Installing APK
To fix this just open the menu in left bottom corner, click on "Build Variants" and select the debug variant (it might have a different name, depending on how many modules/flavors or custom gradle build types you have).
In my case with Android 8.0(Oreo), no one of this solutions worked! If you have more than 1 user, then you should go to Settings->Applications->All Applications->Find the application and uninstall for all users! After this steps, it worked!
It was written above: in my case it was just out of memory on device storage. Add more empty space - and error will disappear
I had this same issue and none of the other solutions worked for me.
Although no errors were shown nor expanded upon in my IDE GUI, I opened up a second Android Studio window window with a different project and noticed in the bottom that the "Event Log" showed an error in a different window, but not in the project I had opened. The issue stated was:
Error: INSTALL_FAILED_CONFLICTING_PROVIDER
Which lead me here - Install shows error in console: INSTALL FAILED CONFLICTING PROVIDER :
I had this FileProvider labeled in the manifest:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="myapp.sameonehere.android.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
Which I had copied from another project and forgotten to rename the 'authorities' String in. After changing it to something unique, it ran without issue.
Make sure you don't have any conflicting authority Strings like in my example.
Also, if no errors are showing up, try opening a second project and see if the "Event Log" shows errors in that location instead.
Go to avd manager and click on Wipe Data of the device you want to run. Worked for me. The size of device on disk will reduce after wiping the data. I hope it helps someone.
Source: Stackoverflow.com