2

my app crashes when i using UnityAds with no internet connection. it happens when my first scene try to start. but when i use internet connection, my game start correctly.

using unity 2017.3.1f1 and Xcode 9.3.

it crashes at:

2018-04-25 15:23:49.269307+0430 name[1664:419120] I/UnityAds: -[UADSInitializeStateConfig execute] (line:139) :: Unity Ads init: load configuration from https://config.unityads.unity3d.com/webview/2.1.0/release/config.json

and the log is:

ballz`::Job_ExecuteUnityWebRequest():
0x1015ee814 <+0>:   stp    x20, x19, [sp, #-0x20]!
0x1015ee818 <+4>:   stp    x29, x30, [sp, #0x10]
0x1015ee81c <+8>:   add    x29, sp, #0x10            ; =0x10 
0x1015ee820 <+12>:  sub    sp, sp, #0x10             ; =0x10 
0x1015ee824 <+16>:  mov    x19, x0
0x1015ee828 <+20>:  add    x0, x19, #0x118           ; =0x118 
0x1015ee82c <+24>:  str    x0, [sp, #0x8]
0x1015ee830 <+28>:  bl     0x1010ef3a4               ; ::Lock() at Mutex.cpp:60
0x1015ee834 <+32>:  ldr    x8, [x19, #0x108]
0x1015ee838 <+36>:  sub    x9, x8, #0x1              ; =0x1 
0x1015ee83c <+40>:  ldr    x8, [x19, #0xf0]
0x1015ee840 <+44>:  ldr    x8, [x8, x9, lsl #3]
0x1015ee844 <+48>:  str    x9, [x19, #0x108]
0x1015ee848 <+52>:  cbz    x8, 0x1015ee870           ; <+92> [inlined] ~AutoLock at UnityWebRequestProto.h:216
0x1015ee84c <+56>:  mov    x0, x19
0x1015ee850 <+60>:  blr    x8

--> 0x1015ee854 <+64>: ldr x8, [x19, #0x108]

0x1015ee858 <+68>:  cbnz   x8, 0x1015ee838           ; <+36> [inlined] back + 4 at UnityWebRequestProto.h:204
0x1015ee85c <+72>:  add    x0, sp, #0x8              ; =0x8 
0x1015ee860 <+76>:  bl     0x100cd4f10               ; ::~AutoLock() at Mutex.h:30
0x1015ee864 <+80>:  mov    x0, x19
0x1015ee868 <+84>:  bl     0x1015ef158               ; ::Release() at UnityWebRequestProto.h:353
0x1015ee86c <+88>:  b      0x1015ee878               ; <+100> at UnityWebRequestProto.h:219
0x1015ee870 <+92>:  add    x0, sp, #0x8              ; =0x8 
0x1015ee874 <+96>:  bl     0x100cd4f10               ; ::~AutoLock() at Mutex.h:30
0x1015ee878 <+100>: sub    sp, x29, #0x10            ; =0x10 
0x1015ee87c <+104>: ldp    x29, x30, [sp, #0x10]
0x1015ee880 <+108>: ldp    x20, x19, [sp], #0x20
0x1015ee884 <+112>: ret    
0x1015ee888 <+116>: mov    x19, x0
0x1015ee88c <+120>: add    x0, sp, #0x8              ; =0x8 
0x1015ee890 <+124>: bl     0x100cd4f10               ; ::~AutoLock() at Mutex.h:30
0x1015ee894 <+128>: mov    x0, x19
0x1015ee898 <+132>: bl     0x101b7e2bc               ; symbol stub for: _Unwind_Resume
BlackMB
  • 230
  • 6
  • 20
  • Do you get crash if you don't show add at-all? I mean you disable any script that is enabling Unity ad? – Programmer Apr 25 '18 at 11:28
  • @Programmer i don't have any code about unityads in my loading scene. when my loading scene starts, unity crashes. – BlackMB Apr 25 '18 at 11:29
  • Bad. File for a bug report. That's the only thing I can think of – Programmer Apr 25 '18 at 11:31
  • I Report it now. but i really need to solve this problem in this week! – BlackMB Apr 25 '18 at 11:49
  • @BlackMB If UnityAds are causing your crash, and you have nothing referencing them in the Loading Scene it is most likely a bug in the ads themselves, not much you can do about that. – AresCaelum Apr 25 '18 at 12:02
  • How did you setup ads in your project? The service window or via the package in the asset store? – AresCaelum Apr 25 '18 at 12:06
  • @Eddge service window. – BlackMB Apr 25 '18 at 12:06
  • @BlackMB Try using the Asset Packge in the store, https://forum.unity.com/threads/bug-issue-in-unity-5-5-1-when-using-ads-from-services-window-use-asset-package.453084/ – AresCaelum Apr 25 '18 at 12:07
  • I change it. But it has this problem again. @Eddge – BlackMB Apr 25 '18 at 12:26
  • The ad API shouldn't run unless you tell it to but it looks like Unity made it to automatically run when the game loads. If that's the case then your only option is to disable ad from the Editor until this issue is fixed. Their are many other ad API to use. – Programmer Apr 25 '18 at 12:40
  • @BlackMB did you disable the service before attempting that? – AresCaelum Apr 25 '18 at 13:12
  • No! It helps? @Eddge – BlackMB Apr 25 '18 at 13:18
  • @BlackMB When using the asset package you shouldn't need to enable the ads via service, if it is enabled via service then it will still attempt to load that system. In the Package you have to initialize and start the ad service yourself but it's only a few lines of code, unity has an example of it. – AresCaelum Apr 25 '18 at 13:19
  • I did uncheck built in, i most uncheck service too? @Eddge – BlackMB Apr 25 '18 at 13:21
  • No just the UnityAds in the services. – AresCaelum Apr 25 '18 at 13:23
  • @Eddge i do it, but the same problem... – BlackMB Apr 25 '18 at 13:48
  • @BlackMB do you know if this is also an issue on android devices? I would like to try and reproduce this but I dont have a way to develop for iOS. – AresCaelum Apr 25 '18 at 15:40
  • @Eddge i don't check it on android devices. unity almost works fine with android. i think this issue is on iOS only. i change my monetize to admob. until unity fix the bug – BlackMB Apr 25 '18 at 17:00

1 Answers1

0

You could try and only initialize the unity ads when you are connected to internet.

if(Application.internetReachability != NetworkReachability.NotReachable)
    {
       //initialize ads here
    }
Isaac Lyne
  • 190
  • 1
  • 3
  • 18
  • App crashes at the start up where just loading code called. I initialize unity ad in second scene. But it crashes in first scene – BlackMB Apr 25 '18 at 23:19
  • Have u got anything other than ads that could be trying to connect to the internet in the fist scene? – Isaac Lyne Apr 25 '18 at 23:32
  • Nop. Nothing. Unity start ads automatically at start. I try to update to patch 4. I think it will be ok in that version. I hope... – BlackMB Apr 26 '18 at 00:01