"Advertisement.Show" restarts my game

Hi, Im trying the sample code: https://gist.github.com/wcoastsands/3d003528a76f94fa2ede

In editor mode runs well, but in my android (aus tf101) only restarts the game.

Could you post a link to the logcat output? Should provide clues in the debug that lead up to the crash.

sure, I attached a file with logcat output

1850305–118668–logcat.txt (306 KB)

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.

I tried even with a new project and nothing changes. And I did use the 1.0.4 version.

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

I sent you a private message with a demo failed project . Did you see it?

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.

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)

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 :slight_smile:

8 Likes

works fine! thks

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

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?

@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.