- Home /
Advertisement.Initialize() NullReferenceException.
Hello, I am at the end of the rope with my current issue. We are targeting iOS and Android with Unity Ads, yet in the editor I get a NullReferenceException
on Initialize.
I do exit if the platform is unsupported ( Advertisement.isSupported
), which should exit in the editor. It seems more of an issue where the singleton is wrongly configured.
Any ideas? I've setup the ads ID and it is showing in the project correctly. I am also using the testMode = true
.
Answer by Socapex · Dec 29, 2015 at 04:30 PM
Also check with isEditor.
if (!Advertisement.isSupported || Application.isEditor) {
return;
}
Seems like a bad design, UnityEngine.Advertisement could easily have been designed to silently and safely be empty (not null) when unsupported.
Answer by LARP · Dec 29, 2015 at 04:49 PM
In versions of Unity integrated with Unity ADS, it is not necessary to call the function: Advertisement.Initialize ()
Your answer
![](https://koobas.hobune.stream/wayback/20220612053424im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
my app has impression more than 5K but ecpm is too low....How it increases ?? 1 Answer
Advertisements does not exist 8 Answers
admob related question 2 Answers
Mobile Ads Frameworks that support unity 0 Answers
Ad Callback 0 Answers