Search Unity

"Advertisement.Show" restarts my game

Discussion in 'Unity Ads & User Acquisition' started by Juaprebo, Nov 16, 2014.

  1. Juaprebo

    Juaprebo

    Joined:
    Nov 15, 2014
    Posts:
    19
  2. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Could you post a link to the logcat output? Should provide clues in the debug that lead up to the crash.
     
  3. Juaprebo

    Juaprebo

    Joined:
    Nov 15, 2014
    Posts:
    19
    sure, I attached a file with logcat output
     

    Attached Files:

  4. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Are you running the demo script on a new GameObject in a new scene? If not, would you mind trying that out?

    Also, if you haven't yet updated the Unity Ads asset package to 1.0.4, try updating the package. Remember to remove the existing Unity Ads assets from your project first before importing the latest package assets.

    https://www.assetstore.unity3d.com/en/#!/content/21027
     
  5. Juaprebo

    Juaprebo

    Joined:
    Nov 15, 2014
    Posts:
    19
    I tried even with a new project and nothing changes. And I did use the 1.0.4 version.
     
  6. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    Might be easier for me to just look at how you have your project setup. If you don't mind, can you export your project as an asset package and send me a link to it in a private conversation?

    Thanks
     
  7. Juaprebo

    Juaprebo

    Joined:
    Nov 15, 2014
    Posts:
    19
    I sent you a private message with a demo failed project . Did you see it?
     
  8. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    I just checked it out. Didn't run into any issues, though. Tested with testMode enabled, as well as disabled. Can you make sure you have the latest Android SDK package files and tools installed and up to date, and that you're using the latest JDK? I'm using JDK 1.8.0u25. Also, I'm using Unity 4.6.0f2.

    What device are you running your build on? The device and Android versions I'm testing with include a Nexus 7 running the developer preview of Android 5, and a Galaxy Nexus running Android 4.3.
     
    Last edited: Nov 19, 2014
  9. Juaprebo

    Juaprebo

    Joined:
    Nov 15, 2014
    Posts:
    19
    I'm using java JDK jdk1.8.0_25 and latest version of Android, Unity 4.6.0b20 and an Asus TF101 transformer running Android 4.0.3. I'm from Spain. I use "build&run" for install the game on the device (for if is important)
     
  10. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    samasaurus6 writes:

    I solved the problem on my android device by going to: Settings > Developer Options > Don't Keep Activities > OFF
    If Don't Keep Activities is ON then it causes the device to close the game when the new activity (the ad) is opened. So then it tries to restart the game since it closed it.

    I really hope this is works for other people too! I spent SOOOO long (over 3 hours) trying to solve it, only to find it was a simple tap to fix! It should also be helpful for you at Unity to know in case someone has this problem in the future :)
     
  11. Juaprebo

    Juaprebo

    Joined:
    Nov 15, 2014
    Posts:
    19
    works fine! thks
     
  12. cradiff

    cradiff

    Joined:
    Feb 7, 2015
    Posts:
    66
    I am sorry to ask a stupid question but I don't see where is the menu "Settings" in Unity 4.6.7. Can you show me by screenshot? Thanks a lot
     
  13. rouge_dev

    rouge_dev

    Joined:
    Dec 3, 2013
    Posts:
    4
    ok, so sorry to start this post again but does this mean that anyone who is having developer settings as "ON" cannot view ads? Or is it only if we enable the ad test mode?

    I noticed that while playing one of the games I installed from the playstore which was made in Unity restarted everytime pressed the button to restart the level.

    Also, will such an activity get recorded as an ad which was viewed or an ad which could not be loaded?
     
  14. unity-nikkolai

    unity-nikkolai

    Joined:
    Sep 18, 2014
    Posts:
    540
    @cradiff: By "Settings" I meant the system Settings app on your Android device.

    @rouge_dev: If the "Don't Keep Activities" option is enabled, the application will be closed when an ad is shown due to the Unity activity being closed.