I have had the same error -505 when I flashed nano gapps using flashfire on cm 12.1
What fixed it for me was flashing a bigger open gapps (full). Note that you don't need to reflash the rom, you can simply flash gapps form zip and it will replace the old ones.
Hope it helps