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 REVMOB_APP_IDS = new Dictionary() {
{ "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();
}
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.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.
↧