I recently integrated Unity IAP in my project and realized that I am getting “The referenced script on this Behaviour (Game Object ‘’) is missing!” warning when I open the game in an Android device. Logcat output is like this:
08-20 21:15:01.783 15244 16972 I Unity :
08-20 21:15:01.879 15244 16972 I Unity : Company Name: company
08-20 21:15:01.879 15244 16972 I Unity : Product Name: gamename
08-20 21:15:02.338 15244 16972 W Unity : The referenced script on this Behaviour (Game Object '<null>') is missing!```
I checked other forum posts regarding this issue, I don't have missing scripts from my prefabs. I also removed all of the scenes from build and added an completely empty scene, however result was the same. In my previous build, there is no error. I only added IAP in this build and I am seeing this error. I have tried the following:
- First I built my app in Unity 2020.3.1 with Unity In App Purchasing package 2.2.2 and Unity Asset Store In App Purchase plugin 2.3.0. I recieved the error above.
- I completely removed IAP from my project. After build, error was gone.
- I upgraded my project to Unity 2020.3.10 and installed Unity In App Purchasing package 3.1.0. After build, same error appeared at the beginning of the app.
I also have Firebase, GameAnalytics, Admost plugins in my project. This error does not cause any problems in app but I still want to get rid of it. Another project I am working on is in Unity 2019.4 with same plugins and same IAP versions and there are no errors in Android build. Any suggestion is appreciated.
@berkc Which script is missing? It looks like you also have a null object, you’ll want to properly debug. We have not heard of this issue. However, are you using Addressables? We do have a known issue with Addressables that we are working on. Can you try by first making a full project backup and then deleting the /Library folder. Then ensure to not switch build targets, and attempt a build. Are you using Codeless or Scripted IAP? We still have work to do on Codeless IAP, so you probably want to avoid it for now.
Hello, sorry for late reply. I cannot see the script’s name. I am not using Addressables. I am also using Scripted IAP, not Codeless. I have tried to delete /Library folder and it didn’t solve this problem. I have updated to Unity 2020.3.18, and IAP 3.2.3 and I am still seeing The referenced script on this Behaviour (Game Object ‘’) is missing!" warning when game starts for the first time. Only way to get rid of this warning is to remove IAP completely for now. It also does not cause any harm to project.