I'm having similar issues with my Note 5 and my Nexus 6P -- I don't get it.  I couldn't install one app on my Note 5, kept getting that same 505 error, so I did a factory reset...  after that I was able to install the app, but now another app won't install.  And the weird part is that the same...