I have recently installed LineageOS custom ROM on my OnePlus2 device to keep on trying new android versions as they come. While installing/updating the OS, I was getting below error on TWRP recovery screen.

script aborted: E3004: This package is for device: OnePlus2,oneplus2; this device is .

To fix this, I updated to the lastest version of TWRP for OnePlus2.