Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The ads Error #364

Closed
SxmGit opened this issue Sep 21, 2022 · 2 comments
Closed

The ads Error #364

SxmGit opened this issue Sep 21, 2022 · 2 comments
Labels
solved Developer confirm that issue solved.

Comments

@SxmGit
Copy link

SxmGit commented Sep 21, 2022

Exception: NullReferenceException: Object reference not set to an instance of an object.

HmsPlugin.HMSAdsKitManager+ConsentUpdateListener.HuaweiMobileServices.Ads.IConsentUpdateListener.OnSuccess (HuaweiMobileServices.Ads.ConsentStatus consentStatus, System.Boolean isNeedConsent, System.Collections.Generic.IList`1[T] adProviders) (at <00000000000000000000000000000000>:0)
HuaweiMobileServices.Ads.ConsentUpdateListener.onSuccess (UnityEngine.AndroidJavaObject consentStatus, System.Boolean isNeedConsent, UnityEngine.AndroidJavaObject adProviderList) (at <00000000000000000000000000000000>:0)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <00000000000000000000000000000000>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.InvokeJavaProxyMethod (UnityEngine.AndroidJavaProxy proxy, System.IntPtr jmethodName, System.IntPtr jargs) (at <00000000000000000000000000000000>:0)
Rethrow as TargetInvocationException: HuaweiMobileServices.Ads.ConsentUpdateListener.onSuccess(UnityEngine.AndroidJavaObject,System.Boolean,UnityEngine.AndroidJavaObject)
UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
UnityEngine._AndroidJNIHelper.InvokeJavaProxyMethod (UnityEngine.AndroidJavaProxy proxy, System.IntPtr jmethodName, System.IntPtr jargs) (at <00000000000000000000000000000000>:0)

@alihan98ersoy
Copy link
Collaborator

alihan98ersoy commented Sep 21, 2022

I check the IConsentUpdateListener.OnSuccess and I believe mAdsManager is null in your case.
resim

You need to call RequestConsentUpdate method before using consent.

You can refer to our demo scene.

@alihan98ersoy alihan98ersoy added the waiting for confirmation The solution has been given label Sep 21, 2022
@SxmGit SxmGit closed this as completed Sep 26, 2022
@alihan98ersoy alihan98ersoy added solved Developer confirm that issue solved. and removed waiting for confirmation The solution has been given labels Sep 26, 2022
@alihan98ersoy
Copy link
Collaborator

Thank you for your interest in our project. You may give us a star to support us and follow up on the project. You can also join our discord channel to follow changes and ask any kind of question about the plugin, gaming ecosystem, etc. You may access it from here: https://discord.io/hmsunityplugin
Thank you and stay tuned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved Developer confirm that issue solved.
Projects
None yet
Development

No branches or pull requests

2 participants