Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Alucardjh · Feb 16, 2016 at 04:11 AM · unity 5adsbannerrevmob

RevMob banner ad crashing game

Hi everybody,

I have a simple game and I have added a revmob banner ad, once this ad is tapped or clicked at, the game crashes, the code for adding the ad is the following:

 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 using System;
  
  
 public class RevMobAdsScript : MonoBehaviour {
  
  
     private static readonly Dictionary<String, String> REVMOB_APP_IDS = new Dictionary<String, String>() {
         { "Android", "mymediaid"}
  
     };
     private RevMob revmob;
     private RevMobBanner revbanner;
  
     void Awake()
     {
         revmob = RevMob.Start(REVMOB_APP_IDS, gameObject.name);
         revbanner = revmob.CreateBanner();
         EventManager.OnAdsBanner += showAd;
         EventManager.OnHideAdsBanner += hideAd;
     }
  
     void showAd()
     {
  
         #if UNITY_ANDROID || UNITY_IPHONE
                 revbanner.Show();
                 EventManager.OnAdsBanner -= showAd;
                 EventManager.OnHideAdsBanner += hideAd;
         #endif
  
  
     }
  
     void hideAd()
     {
         #if UNITY_ANDROID || UNITY_IPHONE
                 revbanner.Hide();
                 EventManager.OnAdsBanner += showAd;
                 EventManager.OnHideAdsBanner -= hideAd;
         #endif
     }
  
 }

I am adding showing/hiding the banner add with custom events, the code for the custom events is the following:

 using UnityEngine;
 using System.Collections;
  
 public class EventManager : MonoBehaviour {
  
     public delegate void ShowBannerAction();
     public static event ShowBannerAction OnAdsBanner;
     public delegate void HideBannerAction();
     public static event HideBannerAction OnHideAdsBanner;
     private GameManager gameManager;
  
     void Awake()
     {
         gameManager = GetComponent<GameManager>();
     }
  
     void Update()
     {
         if (gameManager.IsGameOver)
         {
             showAd();
         }
  
         if (!gameManager.IsGameOver)
         {
             hideAd();
         }
     }
  
     void showAd()
     {
      
         if (OnAdsBanner != null) OnAdsBanner();
      
     }
  
     void hideAd()
     {
         if (OnHideAdsBanner != null) OnHideAdsBanner();
     }
 }
  

The code to activate that triggers de show event is the following:

 void Update()
     {
         if (boardManager.isGameOver())
         {
             GameOver();
         }
         else
         {
             setScore();
         }
  
         if ((Input.GetMouseButtonDown(0) || Input.touchCount > 0) && !boardManager.isGameOver())
         {
             if(Input.GetTouch(0).phase == TouchPhase.Began)
             {
                 if (startUpdating == false && isStartinAnimation == false)
                 {
                     startGame();
                 }
                 else if (startUpdating == true)
                 {
                     trampolineManager.spawnTrampoline();
                 }
             }
          
         }
     }
  
     public void GameOver()
     {
      
         playGameOverSound();
         startUpdating = false;
         gameOverPanel.SetActive(true);
         isGameOver = true;
         setGameOverScore();
      
     }
  }

and finally the code triggering the event that hides the banner is the following:

 public void onReplayButtonClick(){
      
         GameManager.retryCounter++;
         GameManager gameManager =        GameObject.FindGameObjectWithTag("GameManager").GetComponent<GameManager>();
         gameManager.IsGameOver = false;
         SceneManager.LoadScene("BounceTableScene");
  
     }

I enabled bug reports in the corresponding device and part of the trace of the report contains the following:

 ------ SYSTEM LOG (logcat -v threadtime -d *:v) ------
 --------- beginning of crash
 02-06 12:42:06.735 4170 4187 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xb in tid 4187 (GCDaemon)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: FATAL EXCEPTION: main
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: Process: com.Hobbygamesco.Bounceit, PID: 27267
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: java.lang.Error: FATAL EXCEPTION [main]
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: Unity version : 5.3.2f1
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: Device model : motorola XT1040
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: Device fingerprint: motorola/peregrine_retla/peregrine:5.1/LPB23.13-35.5/5:user/release-keys
 02-14 18:27:34.695 27267 27267 E AndroidRuntime:
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.startAnimation(android.view.animation.Animation)' on a null object reference
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at com.revmob.ads.banner.RevMobBanner.hide(Unknown Source)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at com.revmob.ads.banner.RevMobBanner.hide(Unknown Source)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at com.revmob.ads.banner.b.run(Unknown Source)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at android.app.Activity.runOnUiThread(Activity.java:5313)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at com.revmob.ads.banner.a.onClick(Unknown Source)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at android.view.View.performClick(View.java:4785)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at android.view.View$PerformClick.run(View.java:19884)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5343)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
 02-14 18:27:34.695 27267 27267 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: FATAL EXCEPTION: Thread-92678
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: Process: com.Hobbygamesco.Bounceit, PID: 30602
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: java.lang.Error: FATAL EXCEPTION [Thread-92678]
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: Unity version : 5.3.2f1
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: Device model : motorola XT1040
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: Device fingerprint: motorola/peregrine_retla/peregrine:5.1/LPB23.13-35.5/5:user/release-keys
 02-14 18:28:32.707 30602 31199 E AndroidRuntime:
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: Caused by: java.util.ConcurrentModificationException
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at org.json.JSONArray.writeTo(JSONArray.java:612)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at org.json.JSONStringer.value(JSONStringer.java:233)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at org.json.JSONObject.writeTo(JSONObject.java:720)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at org.json.JSONStringer.value(JSONStringer.java:237)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at org.json.JSONObject.writeTo(JSONObject.java:720)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at org.json.JSONStringer.value(JSONStringer.java:237)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at org.json.JSONArray.writeTo(JSONArray.java:613)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at org.json.JSONArray.toString(JSONArray.java:585)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at com.revmob.android.e.a(Unknown Source)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at com.revmob.client.b.a(Unknown Source)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at com.revmob.client.RevMobClient.a(Unknown Source)
 02-14 18:28:32.707 30602 31199 E AndroidRuntime: at com.revmob.client.e.run(Unknown Source)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: FATAL EXCEPTION: Thread-92959
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: Process: com.Hobbygamesco.Bounceit, PID: 31846
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: java.lang.Error: FATAL EXCEPTION [Thread-92959]
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: Unity version : 5.3.2f1
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: Device model : motorola XT1040
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: Device fingerprint: motorola/peregrine_retla/peregrine:5.1/LPB23.13-35.5/5:user/release-keys
 02-14 18:31:11.604 31846 32424 E AndroidRuntime:
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: Caused by: java.util.ConcurrentModificationException
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at org.json.JSONArray.writeTo(JSONArray.java:612)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at org.json.JSONStringer.value(JSONStringer.java:233)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at org.json.JSONObject.writeTo(JSONObject.java:720)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at org.json.JSONStringer.value(JSONStringer.java:237)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at org.json.JSONObject.writeTo(JSONObject.java:720)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at org.json.JSONStringer.value(JSONStringer.java:237)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at org.json.JSONArray.writeTo(JSONArray.java:613)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at org.json.JSONArray.toString(JSONArray.java:585)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at com.revmob.android.e.a(Unknown Source)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at com.revmob.client.b.a(Unknown Source)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at com.revmob.client.RevMobClient.a(Unknown Source)
 02-14 18:31:11.604 31846 32424 E AndroidRuntime: at com.revmob.client.e.run(Unknown Source)
 02-14 18:59:48.499 5626 4618 F google-breakpad: -----BEGIN BREAKPAD MICRODUMP-----

My revmob sdk version is 3.0.9

I would like to know: does anybody know something about this?, does anybody knows if this a known issue or bug in the revmob sdk?, is there a fix for this?, do you think this qualifies for a bug report?. Any help would be appreciated. Thank you.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity Ads Stop Playing On Mobile 0 Answers

How does the money system work in Unity? 0 Answers

Unity Ads not working in existing project but work in new project 1 Answer

How would i know that admob rewarded video ad is avalaible or not . some times rewarded video ad is not available .. 0 Answers

Unity switches scenes when Ad is closed. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges