Failed to parse configuration for gameId: xxxxxx System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
Please help me to resolve these errors.
(1)
Failed to parse configuration for gameId: xxxxx System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
(2)
{"enabled":true,"assetCaching":"forced","projectId":"xxxxxxxxx","placements":[{"id":"video","name":"Video","default":true,"allowSkip":true,"disableBackButton":true,"muteVideo":false,"useDeviceOrientationForVideo":false,"adTypes":["MRAID","VIDEO"],"skipInSeconds":5,"skipEndCardOnClose":false,"disableVideoControlsFade":false,"auctionType":"cpm","useCloseIconInsteadOfSkipIcon":false,"banner":{"refreshRate":30}},{"id":"rewardedVideo","name":"Rewarded Video","default":false,"allowSkip":false,"disableBackButton":true,"muteVideo":false,"useDeviceOrientationForVideo":false,"adTypes":["MRAID","VIDEO"],"skipEndCardOnClose":false,"disableVideoControlsFade":false,"auctionType":"cpm","useCloseIconInsteadOfSkipIcon":false,"banner":{"refreshRate":30}}],"organizationId":"xxxxx","developerId":xxxx,"properties":"","loadV5Enabled":false,"analytics":false,"abGroup":0,"token":"","country":"","subdivision":"","gameSessionId":"","disableAdUnitExperiments":false,"ageGateLimit":0,"coppaCompliant":false,"gamePrivacy":{"method":"unity_consent"},"gdprEnabled":false,"legalFramework":"","optOutEnabled":false,"optOutRecorded":false,"srcPayoutType":"cpi"} System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
(3)
Find can only be called from the main thread. Constructors and field initializers will be executed from the loading thread when loading a scene. Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function. System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
(4)
Invalid configuration request for gameId: xxxxx System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
(5)
Find can only be called from the main thread. Constructors and field initializers will be executed from the loading thread when loading a scene. Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function. System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
.
please help me to resolve these errors.
Answer by EugenAxenoi · May 25, 2021 at 08:24 AM
The callbacks of IUnityAdsInitializationListener interface are not invoked on main thread. This is the reason you see these errors. You're trying to invoke some Unity API in those callbacks. Normally Unity API is forbidden to be called other then main thread.
Answer by EugenDev · Nov 17, 2021 at 05:03 PM
Yes @zonayed . So as I said before you need to make the code which invokes Unity API to run on main thread. Usually you have a class like this:MainThreadDispatcher Inside your PerformWaitCallback should call your code via like this: MainThreadDispatcher.ExecuteMethodOnMainThread(YourFunctionRuningOnMainThread); or a lambda function MainThreadDispatcher.ExecuteMethodOnMainThread(() => { //YourCodeRuningOnMainThread });