I am attempting to run my app in an emulator and have been receiving the following error:
Installation failed since the APK was either not signed, or
I had this same problem occur last night. Running in debug, in my case the app had previously been installed from weeks ago, and I had deleted it, but I was still getting the error and couldn't install it again. I was able to resolve it by going into the AVD manager and wiping user data from there. After that installation and debugging went fine.
I solved it more or less following the answer of Alex K above, but did not know where to look for 'settings' (total beginner!).
So go to the AVD manager (icon of mobile in toolbar) and click on the arrow on the far right, a small menu appears and here you select 'Wipe Data'.
You do need to first close the emulator.
There may be already install current app with certificate
uninstall it and try again
What I tried:
None of those solved the issue. In the end I executed the compilation/signing steps manually until I found the culprid: One of the file in my asset folder was 'Icon?' generated by MacOSX
In order to detect it I followed the instructions here to Build an unsigned APK and sign it manually: https://developer.android.com/studio/publish/app-signing#sign-manually
When I ran step 3 (apksigner) I got an exception with message cannot sign apk because of file ..\folder\folder\Icon?
I understand that what was happening is that Android Studio did not capture the exception and tried to deploy the unsigned application onto the emulator.
Once I removed the file and tried again I no longer had the issue. (quite a pain to find the root cause...)
So, step 1:
This problem can be resolved by below two ways
First solution works when you built your application in debug mode. But, once you are ready to publish your application on Google Play store you need to go by second way.
Read for more -> Sign Your App
Hope this will help one and all!
If you still get this error in debug mode, follow these steps:
This works for me on Android 2.2 Beta.