Recently fixed this issue for a BMW X5 2011 35D. Check engine light on with the P0102 & P0112 code.
Steps taken to fix the issue:
Step 1. Changed the engine air filter (
https://www.amazon.com/gp/product/B006EGQ8ZU) with no success. The filter was overdue anyways.
Step 2. Replaced bosch maf sensor with new bosch oem sensor (
https://www.amazon.com/Bosch-Origina.../dp/B00BHL3GE8)
Step 3: Drove for about 50 miles and the check engine light went away after a few starts.