Home > Tips and Tricks

Error: recovery: Package is for product ‘x’ but expected ‘y’ [Fixed]

In this guide, we will show you the steps to fix the Error: recovery: Package is for product ‘x’ but expected ‘y’. When it comes to flashing custom ROMs, there are quite a few approaches that you could take. These include the likes of installing it via a custom recovery like TWRP/OrangeFox, etc, or via an AOSP Recovery that comes with the ROM itself, such as LineageOS Recovery, and EvolutionX Recovery, among others.

If we talk about the latter approach, then you’ll have to sideload the ROM ZIP file, which on paper, is a relatively easier task. However, in some instances, it might prove to be easier said than done as we have already seen numerous issues happening while carrying out this task, including the popular error codes 1 and 7, and the SPL Downgrade. And now, there’s a new issue in town.

Numerous users have voiced their concern that they are getting bugged with the Error: recovery: Package is for product ‘x’ but expected ‘y’. Here, x is the ROM’s actual region for which it is built and y is the region of your device. So the error is trying to convey that there’s a mismatch between both of them. In other words, the region for which this ROM is built is not the same as the device/firmware region that is installed on your device.

Package is for product but expected

For example, I’m facing this error with my Poco F5, whose codename is marble which is also the target firmware for the ROM that I’m trying to flash but since my device has India India firmware, it has marbleein as the codename, and hence there’s a mismatch between the region of the ROM and my device, which results in the failure of the flashing of the ROM.

Moreover, as you might have guessed, in my case, x stands for marble whereas y stands for marblein in the aforementioned error. If you are also facing this issue, then this guide will make you aware of a nifty workaround that should help you rectify this problem. So without further ado, let’ check it out.

Fix Error: recovery: Package is for product ‘x’ but expected ‘y’

Package is for product but expected

There are two different that you can take- either unpack the ROM first, try out the tweak, and then repack it [recommended] or carry out the entire process within the compressed ROM itself. We have listed both these methods below, go through them once and then try out the one that is in sync with your requirements.

Moreover, as of now, your device will be stuck on the AOSP Recovery with the aforementioned error message. So before proceeding ahead, make sure to do a Format Data for a fresh start. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.

The Prerequisites

  • For extracting the ROM, it is recommended that you use the 7ZIP software as the default built-in Windows extraction tool tends to mess up with the ROM compression/decompression. So download and install it from its official site.
  • Apart from that, we will also need an advanced text editor. In this regard, you can try using the Notepad++ software.

METHOD 1: ROM Extraction

  1. To begin with, extract the ROM ZIP file via 7ZIP. To do so:
    Right-click on the file > Show More Options > 7ZIP > Extract to <filename>
  2. Then go to META-INF > com > android > metadata.
  3. Now open the metadata file via Notepad++.Package is for product but expected
  4. Then have a look at the error message on your device.
  5. Note down the ‘y’ value, which in my case is marblein.
  6. Now change the last line, having the pre-device keyword, as follows
    pre-device=y_value
  7. Make sure to replace the y_value. In my case, it will be
    pre-device=marblein

    Package is for product but expected

  8. Once you have made the changes, hit Ctrl+S to save it.
  9. Now compress the ROM ZIP file via 7ZIP as follows:
    Right-click on the file > Show More Options > 7ZIP
    Add to Archive > Change Archive Format to ZIP > OK.
  10. Finally, retry flashing this ROM file via ADB Sideload.

METHOD 2: Without Extracting the ROM

  1. Go to ROM > META-INF > com > android > metadata.
  2. Now open the metadata file via Notepad++.Package is for product but expected
  3. Then have a look at the error message on your device.
  4. Note down the ‘y’ value, which in my case is marblein.
  5. Now change the last line, having the pre-device keyword, as follows
    pre-device=y_value
  6. Make sure to replace the y_value. In my case, it will be
    pre-device=marblein

    Package is for product but expected

  7. Once you have made the changes, hit Ctrl+S to save it.
  8. Finally, retry flashing this ROM file via ADB Sideload.

So these were the two different methods through which you can fix the Error: recovery: Package is for product ‘x’ but expected ‘y’. All your queries with regard to the aforementioned steps are welcomed in the comments section below.


Share: