Infiniti Qx4 won't pass inspection!

I’ve got a 2000 Infiniti Qx4 that I can NOT get to pass inspection. I replaced the engine at 130,000 miles, and since then I’ve had nothing but problems. I live in TN and I’ve got to pass emissions testing. The car drives/runs great, no problems. I’m down to code P1105 or something, MAP/solenoid valve… Or maybe it was P10107 or something. Anyways it means the MAF sensor is malfunctioning or I’ve got bad hoses or electrical connections near the intake. Sooo I replace the MAF. Nope, check engine light still on. I replace the clips on the hoses for the MAF. Nope, still on. I check all the wires n all the hoses. Nope, light still on. Now my mechanic is going on about I might have a bad computer or it might not have accepted the new engine as it was from a different year (still a 3.3L V6 standard of the prior to 2001 model)
Has anyone had this problem? Any ideas?
My mechanic has been at it for over 2 weeks trying all kinds of stuff but to no avail.

A few questions. 1) when they replaced the motor did they use the computer from the motor or from the truck??
2) did the MAF sensor come from the truck or the motor? When replaced which one did the mech use?

Motor swaps in a modern car is not as straight forward as it used to be in older cars. While the mote itself may be the same from year to year, it is very common for the manufacturer to make small changes to wiring and sensors from year to year. If you are running a mismatch of parts that may be your issue. This is where I would start especially if you still have your old motor around.

Engine swaps are seldom done any more…You are an example of why…Those who DO try it always use the ECM out of the donor car that matches the engine…Everything has to match up perfectly or the CEL will not allow you to pass an emissions test…

Caddyman, what is the CEL? I’m not sure if the engine was from a different year or not… according to the Nissan tech I spoke to all the engine is exactly the same. This isn’t something I knew going into the swap. The MAF sensor came from my truck, it wasn’t changed… we ordered a new one OEM. I’m thinking of hooking it up to the infiniti computer down at the dealership that should tell me exactly what’s wrong. I bought the engine from Wisconsin, shipped here to Nashville on freight. For all I know it came from a junkyard. But, it was a complete unit with low miles and in great shape… I didn’t know I’d run into these problems. If I change the computer with a new one will that solve it?

Caddyman, what is the CEL?

CEL = Check Engine Light