-1

I have built a release APK of my app.

If I try to install it from Play Store I get Error -504. Users have also reported to have the same problem.

I was able to catch logcat from the failure:

04-18 10:22:41.487 3713-3713/? I/Finsky: [1] com.google.android.finsky.download.DownloadBroadcastReceiver.a(45): Intent received at DownloadBroadcastReceiver
04-18 10:22:41.505 3713-3713/? I/Finsky: [1] com.google.android.finsky.download.x.b(404): com.faendir.kepi.vpviewer: onProgress 1842784/1842784 Status: 200.
04-18 10:22:41.507 3713-3713/? I/Finsky: [1] com.google.android.finsky.download.e.a(244): com.faendir.kepi.vpviewer from 2 to 3.
04-18 10:22:41.519 3713-3713/? I/Finsky: [1] com.google.android.finsky.download.x.b(603): com.faendir.kepi.vpviewer: onComplete
04-18 10:22:41.523 3713-3713/? I/Finsky: [1] com.google.android.finsky.download.x.i(344): Download com.faendir.kepi.vpviewer removed from DownloadQueue
04-18 10:22:41.524 308-308/? I/installd: free_cache(0) avail 1213521920
04-18 10:22:41.525 3713-3713/? I/Finsky: [1] com.google.android.finsky.receivers.v.c(24906): Prepare to copy com.faendir.kepi.vpviewer (com.faendir.kepi.vpviewer) from content://downloads/my_downloads/2469 (expect 1842784 bytes, isGzipped: false)
04-18 10:22:41.657 3713-3764/? I/Finsky: [8067] com.google.android.finsky.receivers.y.a(2959): com.faendir.kepi.vpviewer (com.faendir.kepi.vpviewer) (1842784 bytes) copied successfully in 116 ms
04-18 10:22:41.762 3713-3713/? I/Finsky: [1] com.google.android.finsky.receivers.y.onPostExecute(4040): Successfully copied APK to update com.faendir.kepi.vpviewer (com.faendir.kepi.vpviewer)
04-18 10:22:41.763 3713-3713/? I/Finsky: [1] com.google.android.finsky.receivers.v.c(28120): Begin install of com.faendir.kepi.vpviewer

                                         [ 04-18 10:22:41.782  1102: 1159 W/         ]
                                         Zip: missed a central dir sig (at 0)
04-18 10:22:41.782 1102-1159/? W/zipro: Error opening archive /data/app/vmdl2071847660.tmp/com.faendir.kepi.vpviewer: Iteration ended
04-18 10:22:41.782 1102-1159/? D/asset: failed to open Zip archive '/data/app/vmdl2071847660.tmp/com.faendir.kepi.vpviewer'
04-18 10:22:41.791 1102-1159/? E/PackageInstaller: Commit of session 2071847660 failed: Failed to parse /data/app/vmdl2071847660.tmp/com.faendir.kepi.vpviewer
04-18 10:22:41.816 3713-3713/? E/Finsky: [1] com.google.android.finsky.installer.x.onReceive(2496): Error -504 while installing com.faendir.kepi.vpviewer: INSTALL_PARSE_FAILED_NOT_APK: Failed to parse /data/app/vmdl2071847660.tmp/com.faendir.kepi.vpviewer
04-18 10:22:41.816 3713-3713/? W/Finsky: [1] com.google.android.finsky.receivers.ah.a(2152): Install failure of com.faendir.kepi.vpviewer: -504 null
04-18 10:22:41.823 3713-3713/? I/Finsky: [1] com.google.android.finsky.receivers.v.a(766): Cancel running installation of com.faendir.kepi.vpviewer (com.faendir.kepi.vpviewer)

Does anyone know what could cause this?

Note 1: If I install the APK from external storage it works without problem.

Note 2: I have seen this question, and this is not the problem.

Note 3: Google doesn't give anything useful when searching for INSTALL_PARSE_FAILED_NOT_APK, which seems to be the core problem to me.

Community
  • 1
  • 1
F43nd1r
  • 7,690
  • 3
  • 24
  • 62
  • So you updated the version code before releasing it? And did it work when you signed it and ran on your device? – Eenvincible Apr 18 '16 at 19:54
  • Yes, the version code was increased. Otherwise the developer console would reject the upload. Yes, the **exact same apk** install fine when loading manually. – F43nd1r Apr 18 '16 at 19:56
  • @F43nd1r can you add the link to the app?. – Rod_Algonquin Apr 18 '16 at 20:10
  • https://play.google.com/store/apps/details?id=com.faendir.kepi.vpviewer You will probably only be able to view/download this from Germany. – F43nd1r Apr 18 '16 at 20:11
  • Try to clear all cache and data of your app and Google Play Services. Then try to install your app again. – GoRoS Apr 18 '16 at 20:13
  • @GoRoS I already tried that. Also the app was not present on the device at install time. – F43nd1r Apr 18 '16 at 20:18
  • I suspect it could be conflicting libraries used somewhere in your app – Eenvincible Apr 18 '16 at 20:19
  • @Eenvincible but why would a manual install work then? Also my dependency tree shows no different versions (the only library referenced by multiple others is support-v4) – F43nd1r Apr 18 '16 at 20:22
  • All these involve trial and error; would you please try installing on a different device or emulator? – Eenvincible Apr 18 '16 at 20:25
  • It install fine through adb on an emulator. I have no emulator with a Play store. – F43nd1r Apr 18 '16 at 20:44

1 Answers1

0

We had similar problem yesterday. If we install from google play, the logcat message shows Google Play Error -504 INSTALL_PARSE_FAILED_NOT_APK

In the end, we find it is the problem of one of the CDNs google used to serve the content.

We re-sumbit the same apk with a new version code to force the CDNs to refresh. After that, all things worked.

Luckydog
  • 16
  • 1