problem installing over an app installed from google play I encountered The following issue on two samsung galaxy s4 devices:

When trying to install a newer version of an by clicking an APK file in an email message it works o.k..
If trying to install another new copy from a new APK over the previously installed one it also work.

But if the original version from google play is installed and we try to install the APK from the email we get a message App not installed and obviously the app does not get installed...

just to clarify - both the versions are written by me, both signed and use the same ID.
and there is a major version number change between them.

How can I know if things will go o.k. if I submit the new version to Google play?
Is there an official limit that refers the the source of installation having to be the same for an update?
Is there any way to override this limit?  

UPDATE:  

I followed the advice given by @GiantTree in this conmment 

I installed a terminal emulator and executed pm install -r mypackage.apk which gave something like 60 lines saying try again in 1second (missing space in original message) then it said twice failed to connect to dumpstate service and finally killed.

Executing logcat &gt;log.txt I found the line:
`java.lang.SecurityException: 


  Neither user 10210 nor current process has android.permission.INSTALL_PACKAGES.


UPDATE 2:

upon better examining of the log file I found this line:


  D/InstallAppProgress( 8973): Installation error code: -25


but I can't find what does this error code means...  

Still Looking for further suggestions...
This error often occurs when you try to install an older version over an already-installed newer version of the same app. If that's really what you intend to do, you might first have to uninstall and then re-install the app in question. To not lose its data, you can try uninstalling via adb uninstall -k &lt;package&gt;: this would uninstall the app, but keep (-k) its data.

For further details, you might also wish to see:


Unknown error code during application install: “-25”