Unloading broken assembly error with UnityPurchasing

I’m using Unity 2018.2.f02. I’m having this frustrating issue with Unity IAP showing errors in the editor after updating to the latest IAP version.

Unloading broken assembly Assets/Plugins/UnityPurchasing/Bin/Editor.dll, this assembly can cause crashes in the runtime.
Unloading broken assembly Assets/Plugins/UnityPurchasing/Bin/Stores.dll, this assembly can cause crashes in the runtime

Which then of course leads to all sorts of errors such as Assets/Scripts/IAPManager.cs(9,42): error CS0246: The type or namespace name `IStoreListener’ could not be found. Are you missing an assembly reference?

I’ve completely cleaned out my project and re-imported everything twice now, and I still have this issue.

How do I fix this?

This is not an error that we are familiar with. Does it occur on a brand new project? There is this forum post about the import/upgrade process that may help: IAP Troubleshooting - Remove and Reinstall Unity IAP

It actually seemed to happen after I imported a specific asset from the asset store into my racing game project.

This asset by default overwrites my project settings, tags and layers etc. so I just unchecked these options and the problem went away.

Still no idea why it would cause Unity IAP to break though.

I didn’t test it on a brand new project

Well, I HAVE tested it on a brand new project and on a project that I pulled down from the Unity Cloud… a Published Android game. Is it possible to fix this? I followed the remove and reinstall process and I still get the error.
If I remove “Stores.dll” it causes more errors. (Sorry if my tone is off, this is super frustrating.)

You didn’t say the results of your testing on a brand new project, prior to loading any assets. Let’s start there. Can you build a brand new project with a SampleScene? Please share the results and a screenshot of the Editor with the Console showing

So far, the IAP Installer dialog box pops ups, and then breaks. I tried reimporting the stores.dll and it pulls up the IAP installer Dialog box. Give me a few minutes, and I will make a new blank project with the IAP in it. And, I’ll put up a screenshot.

new project, went into the services tab, clicked the flipswitch to enable it, and and it popped up with the IAP installer. I said “Install Now”. Then this popped up.

I click ok, and then click Import on the right, in the services window. It asks again if i want to Install Now, I click “Install Now” And … it goes through the import package routine.
It’s now asking me if I want to upgrade the project.

I told it to go ahead, and now it’s not wanting to go boom on the stores.dll.

Sorry, as requested, let’s start with an empty project and build and deploy first. Then add IAP, etc. But to your screenshots, yes you want to upgrade the API. You must say yes to this prompt as mentioned in the upgrade link I provided previously IAP Troubleshooting - Remove and Reinstall Unity IAP

okay should I delete this project and do it over again, building it first?
And, should I set it to be an Android project, like where I am having the issue?

(And, on the old project that I pulled down from Collab, I deleted the two directories, clicked import and still had issues…)

I would recommend that you follow my directions, Build and Run to Android with the (empty) SampleScene with no assets loaded (to assure the basics are working first)

That was just a confirmation question.

Note: new project, switched to Android. Building. Nothing in the project except for the blank scene.

Interesting. There’s the Aapt.exe Win32Exception error again. (that right there is why I pulled the last published version of my android game down from the cloud. Anyway.)

I suspected you might have an error (which by the way is unrelated to IAP, you have a wider issue). So you’ve never been able to build to Android on this system?

It worked fine until I switched to 2018… and updated the sdk via 2018 by changing it from Nougat (API Level 25) to Oreo (API Level 27), and it helpfully installed the new sdk API level for me.

Got it. In that case, I would recommend you post in the Android forum, there will likely be persons there that can assist you further Unity Engine - Unity Discussions

Thank you. Very helpful. Unfortunately, the issue that I am having (Because, I can fix the android compile issue myself) Is still with the Unity IAP and the fact that in my working game, Stores.dll. is being unloaded because it’s “Known to break games during runtime”

So… Can we please fix that?

That is exactly what we are working on. Get the compiler issue working first, then we’ll get IAP working. First things first!