Application not installed (different) So when I updated my Android to 4.4.2, the default Samsung Gallery app disappeared. Now, I decided to dig into the files of the Android 4.4.2 update and extracted the system.img and found the application, named SecGallery2013.apk I copied it to my SD Card and tried to install it normally, it gave the error "Application not installed" So I tried to install it via ADB, but it gave an error "INSTALL_FAILED_UID_CHANGED" so I digged into my phone and found the same APK in system/priv-app and I deleted it and after that, I tried again but this time it gave the error: "INSTALL_FAILED_DEXOPT" Things I've tried:


I got a logcat and this was the result, hope someone can understand:


[ 05-19 20:02:46.951  1604: 1728 W/SELinuxMMAC ]

assignSeinfoValue, matching key found



[ 05-19 20:02:46.951  1604: 1728 W/SELinuxMMAC ]

assignSeinfoValue , step 2, pkgName:com.sec.android.gallery3d, seinfo:platform



[ 05-19 20:02:46.951  1604: 1728 W/SELinuxMMAC ]

assignSeinfoValue, step 4, pkgName:com.sec.android.gallery3d, seinfo:platform



[ 05-19 20:02:46.951  1604: 1728 I/SELinuxMMAC ]

com.sec.android.gallery3d registered as an RCP File Copier App.



[ 05-19 20:02:46.951  1604: 1728 D/PackageManager ]

Time to scan apk: 0.638 seconds



[ 05-19 20:02:46.951  1604: 1728 W/PackageManager ]

Package couldn't be installed in /data/app/com.sec.android.gallery3d-1.apk



[ 05-19 20:02:46.951  1604: 1728 D/PackageManager ]

doPostInstall for uid{-1}



[ 05-19 20:02:46.951  1604: 1728 D/PackageManager ]

delete sourFile : 



[ 05-19 20:02:46.951  1604: 1728 D/PackageManager ]

delete native library directory: 



[ 05-19 20:02:46.951  1604: 1728 D/PackageManager ]

+ starting rerstore round-trip 1



[ 05-19 20:02:46.951  1604: 1728 D/PackageManager ]

No resotre for backup - queue post-install for 1




I checked another place and it said error code -24, I've did every suggestion on this site and none of them worked (except for factory resetting)
Deleted all remaining files from gallery data, didn't work


Samsung Galaxy Note II, running rooted stock android 4.4.2.

Thanks!
I finally figured out how to fix this.

What I did


I did a double factory reset: Nothing happened.
Downgraded to Android 4.2.2: Nothing happened.
Downgraded to Android 4.1.2: Nothing happened.
Upgraded to Android 4.3: Nothing happened.
Factory Reset: Gallery appeared!
Upgraded to Android 4.4.2: Gallery didn't disappear!