Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[object OBJECT] error when enabling ads from Services

Discussion in 'Unity Ads & User Acquisition' started by bandungfacv, May 5, 2017.

  1. bandungfacv

    bandungfacv

    Joined:
    May 2, 2017
    Posts:
    4
    Hi,

    We've been having error enabling the ads from the services tab. Keep on getting [object Object] error. The other services can enable and disable

    Edit:
    Tested this on
    macos 10.12.4
    unity 5.6.0f3

    Thanks
     

    Attached Files:

    Last edited: May 5, 2017
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Hi,

    I've just tried here on same configuration and was able to enable ads. However seems that we do have an issue where Ads sometimes needs to be enabled twice, probably related to setting COPPA flag/timing for project.

    Can you try again, and let us know if you still have problems?

    Thanks,
    Rasmus
     
  3. bandungfacv

    bandungfacv

    Joined:
    May 2, 2017
    Posts:
    4
    I did try multiple times, but no dice.

    I finally managed to fix it though. It seems that these var in UnityConnectSettings.asset were empty .
    m_IosGameId:
    m_AndroidGameId:
    So after setting it up with either 0 or the real id, the problems go away

    Cheers
     
  4. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Ok, thanks for reporting. As said, have seen similar issue myself where Ads needs to be enabled twice in services window. We will look into this.
     
  5. bandungfacv

    bandungfacv

    Joined:
    May 2, 2017
    Posts:
    4
    If it's any help, the project was previously running on 5.5.0f3
     
  6. bandungfacv

    bandungfacv

    Joined:
    May 2, 2017
    Posts:
    4
    Rasmus, it seems that the fix didn't help me that much. Now I've got this error

    Assets/Scripts/Objects/ResultScreen.cs(4,20): error CS0234: The type or namespace name `Advertisement' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?

    The build is already set to either Android or iOS. This post led me to discover that the OBJECT object error will return if I turned off the ads in services.
     
  7. rsherzod

    rsherzod

    Joined:
    Oct 30, 2016
    Posts:
    5
    Hi All,
    Is there any news on this error, I am getting same message, but my apps are not in store yet. I am trying to enable ads in Unity editor and it is not getting enabled.
     

    Attached Files:

  8. dsabatier

    dsabatier

    Joined:
    Jul 15, 2014
    Posts:
    3
    Edited by moderator: This post suggested replacing m_IosGameId and m_AndroidGameId with zeroes in ProjectSettings/UnityConnectSettings.asset. This might show ads, but will mean that any revenue is not linked to you. You need to use correct game ids, which can be found from https://dashboard.unityads.unity3d.com/

    Revenue from your game is attributed using the game id, which links to your account, so for that reason better make sure it's correct :)
     
    Last edited by a moderator: May 31, 2017
  9. ZBSgames

    ZBSgames

    Joined:
    May 31, 2017
    Posts:
    1
    hi, I have same problem
    adding 0 isn't fix it
     
  10. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Have been talking with @ZBSgames offline. Don't replace game ids in ProjectSettings/UnityConnectSettings.asset with zeros...

    Example of a working UnityConnectSettings.asset file: (remember to change project serialization to "Text only")

    Code (CSharp):
    1.   UnityAdsSettings:
    2.     m_Enabled: 1
    3.     m_InitializeOnStartup: 1
    4.     m_TestMode: 0
    5.     m_EnabledPlatforms: 4294967295
    6.     m_IosGameId: (iOS game id)
    7.     m_AndroidGameId: (Android game id)
     
  11. DanielBatoff

    DanielBatoff

    Joined:
    Jan 31, 2017
    Posts:
    2
    I was having the same issue, and our project was at one time also using 5.5.0f3 in case that's any part of the issue.

    The issue was occurring on my PC whenever I tried to enable the ads services. So I updated the project through subversion onto my Mac, and Unity had no trouble enabling the ads services on the Mac. Then after committing and updating back on my PC, Unity Ads were enabled.

    Unfortunately this is just a workaround; when I tried disabling and re-enabling the ad services on my PC, it would go back to having the [object Object] error. So all I can suggest for now is to try enabling the services on a different machine and hope that works. This workaround may not need a Mac involved, I just don't have a second PC to test with.
     
  12. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Thanks, we will test here on Windows with Unity 5.5 (however should work ofc...)

    /Rasmus