When flashing a custom ROM, why do I get an error on getprop("ro.product.device")? Whenever I try to flash a ROM on my ASUS Transformer Prime (tf201), I get the following error:

assert failed: getprop("ro.product.device") == "tf201" || getprop("ro.build.product") == "tf201"


I've got around it by opening the ZIP file of the ROM, navigating to /META-INF/com/google/android/updater-script and just removing this check. The ROM installs fine then. 

But still I'm left with the question: why isn't my device recognized as a tf201, while it obviously is? Is it because I formatted the system partition in a format frenzy?
This could be caused by a variety of reasons, the primary reason being an incompatible recovery, where the appropriate variables aren't correctly set. Try using another recovery (example: TWRP) , and see if you're getting this error.

A temporary solution for this would be:

You could just open up the zip file, extract the 


  META-INF/com/google/android/updater-script


file, and remove the getprop lines, which look like:


  getprop(xyz) == "xyzyxz");


lines from it. These lines are usually in the beginning of the updater-script file.

As you say that the ROM is "for" your device, this should cause no problems.

Then, just drag-drop back the updater-script file, back into the zip. Now, flashing wouldn't be causing any problems.

Note that:

Use programs like 7-zip, or WinRAR, while extracting the updater-script file.
Use the Notepad++ text-editor, or alternatives like Geany, which support the Linux EOL formats.