Search code examples
androidunity-game-engine

Unity game crashes cos of Google Admob


My Game made with unity crashes every time if there is not internet access on the android phone. And reason for crashing is Google AdMob ads.

This started to happening after I changed compilation mode from IL2CPP to mono, then reversed it. Now is again on IL2CPP but still got this ERROR.

The version before that did not have this problems. So what could I change or where did I go wrong to make this start happening?


Solution

  •  if(Application.internetReachability == NetworkReachability.NotReachable)
     {
         Debug.Log("Error. Check internet connection!");
     }
    

    This Checks for if there is active internet solution. But this is just temporary solution. I suggest go to the GOOGLE ADMOB UNITY page again and check Unity Play Services Resolver library part. Google points out resolver is really good at fixing dependencies. If not just uninstall AdMob and reinstall.