[Android Q&A, Help & Troubleshooting] rigman:
If I have this in the wrong forum, please let me know.

I have 4 APK's on the market all built from one code base, (using Flavors for different package names). I have 4 users that have reported the apps won't run if it was installed prior to upgrading to Lollipop. So they uninstall and try to reinstall and get an error 504. I also have new users on Lollipop that can't get the apps to install and also receive an error 504.

I've tried all the methods to fix the problem that I can find. Clearing data and cache for the play store and Google framework. Adding and removing the Google account. Factory reset, etc. The problem is occurring on different brands of phones and different carriers.

I had one of the users run a bug report and here are some of the relevant lines of text I see.

03-26 20:03:41.735 990 1037 D PackageManager: /data/app/vmdl1004952596.tmp already staged; skipping copy

03-26 20:03:41.965 990 1037 D PackageManager: Renaming /data/app/vmdl1004952596.tmp to /data/app/com.blogspot.poolmobile.poolpro-1

03-26 20:03:46.375 990 1037 W PackageManager: Package couldn't be installed in /data/app/com.blogspot.poolmobile.poolpro-1

03-26 20:03:46.375 990 1037 W PackageManager: com.android.server.pm.PackageManagerException: scanPackageLI

03-26 20:03:46.375 990 1037 W PackageManager:	at com.android.server.pm.PackageManagerService.scanPackageDirtyLI(PackageManagerService.java:6552)

03-26 20:03:46.375 990 1037 W PackageManager:	at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:5794)

03-26 20:03:46.375 990 1037 W PackageManager:	at com.android.server.pm.PackageManagerService.installNewPackageLI(PackageManagerService.java:11029)

03-26 20:03:46.375 990 1037 W PackageManager:	at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:11690)

03-26 20:03:46.375 990 1037 W PackageManager:	at com.android.server.pm.PackageManagerService.access$2700(PackageManagerService.java:269)

03-26 20:03:46.375 990 1037 W PackageManager:	at com.android.server.pm.PackageManagerService$6.run(PackageManagerService.java:9430)

03-26 20:03:46.375 990 1037 W PackageManager:	at android.os.Handler.handleCallback(Handler.java:739)

03-26 20:03:46.375 990 1037 W PackageManager:	at android.os.Handler.dispatchMessage(Handler.java:95)

03-26 20:03:46.375 990 1037 W PackageManager:	at android.os.Looper.loop(Looper.java:155)

03-26 20:03:46.375 990 1037 W PackageManager:	at android.os.HandlerThread.run(HandlerThread.java:61)

03-26 20:03:46.375 990 1037 W PackageManager:	at com.android.server.ServiceThread.run(ServiceThread.java:46)

PendingIntentRecord{35429cd3 com.android.vending startActivity}

uid=10078 packageName=com.android.vending type=startActivity flags=0x40000000

requestCode=-1050172287 requestResolvedType=null

requestIntent=act=com.google.android.finsky.DETAILS dat=details?doc=com.blogspot.poolmobile.poolpro cmp=com.android.vending/com.google.android.finsky.activities.MainActivity (has extras)

#169: act=com.android.vending.INTENT_PACKAGE_INSTALL_COMMIT.com.blogspot.poolmobile.poolpro flg=0x10 (has extras)

extras: Bundle[{android.content.pm.extra.STATUS=4, android.content.pm.extra.SESSION_ID=1004952596, android.content.pm.extra.LEGACY_STATUS=-11, android.content.pm.extra.STATUS_MESSAGE=INSTALL_FAILED_DEXOPT: Package couldn't be installed in /data/app/com.blogspot.poolmobile.poolpro-1: scanPackageLI}]

173: act=android.intent.action.PACKAGE_NEEDS_VERIFICATION dat=file:///data/app/vmdl1004952596.tmp typ=application/vnd.android.package-archive flg=0x11 (has extras)

extras: Bundle[{android.content.pm.extra.VERIFICATION_ID=15, android.intent.extra.ORIGINATING_UID=10078, android.content.pm.extra.VERIFICATION_PACKAGE_NAME=com.blogspot.poolmobile.poolpro, android.content.pm.extra.VERIFICATION_INSTALL_FLAGS=18, android.content.pm.extra.VERIFICATION_VERSION_CODE=74, android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE=com.android.vending}]

Recent #20: TaskRecord{14e145f3 #1572 A=com.android.packageinstaller U=0 sz=1}

userId=0 effectiveUid=u0a184 mCallingUid=u0a184 mCallingPackage=com.android.packageinstaller

affinity=com.android.packageinstaller

intent={act=android.intent.action.VIEW dat=file:///storage/emulated/0/Download/poolPro-poolPro-release.apk typ=application/vnd.android.package-archive flg=0x10880001 cmp=com.android.packageinstaller/.PackageInstallerActivity}

realActivity=com.android.packageinstaller/.PackageInstallerActivity

autoRemoveRecents=true isPersistable=false numFullscreen=1 taskType=0 mTaskToReturnTo=1

rootWasReset=false mNeverRelinquishIdentity=true mReuseTask=false

Activities=[ActivityRecord{1546ce83 u0 com.android.packageinstaller/.InstallAppProgress t1572}]

askedCompatMode=false inRecents=true isAvailable=true

lastThumbnail=null lastThumbnailFile=/data/system/recent_images/1572_task_thumbnail.png

hasBeenVisible=true firstActiveTime=1427038381863 lastActiveTime=1427038381863 (inactive for 380050s)

Any help is greatly appreciated.

Ronnie