Skip to content

Firebase Auth crash in Initialization step when running the app for the second time #416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mantoun1984 opened this issue Jul 12, 2019 · 36 comments

Comments

@mantoun1984
Copy link

mantoun1984 commented Jul 12, 2019

Please fill in the following fields:

Unity editor version: 2019.1.8
Firebase Unity SDK version: 6.1.1 (I tried also 6.2.1)
Firebase plugins in use (Auth, Database, etc.): Auth
Additional SDKs you are using (Facebook, AdMob, etc.): nothing
Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows
Platform you are targeting (iOS, Android, and/or desktop): Android

Please describe the issue here:

  • Download Auth test app from "Firebase-Test".
  • Add Firebase SDK to the project
  • Build and run
  • Sign in anonymously
  • Close the app (by pressing android hardware back Button)
  • Open the app again and the crash will appear at startup
    07-12 20:20:04.831: E/CRASH(5102): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr c548f3b0 
    07-12 20:20:04.831: E/CRASH(5102): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 
    07-12 20:20:04.831: E/CRASH(5102): Build type 'Development', Scripting Backend 'il2cpp', CPU 'armeabi-v7a' 
    07-12 20:20:04.831: E/CRASH(5102): Build fingerprint: 'samsung/j7y17ltexx/j7y17lte:8.1.0/M1AJQ/J730FXXU3BRL3:user/release-keys' 
    07-12 20:20:04.831: E/CRASH(5102): Revision: '7' 
    07-12 20:20:04.831: E/CRASH(5102): pid: 5102, tid: 5260, name: UnityMain >>> com.google.FirebaseUnityAuthTestApp.dev <<< 
    07-12 20:20:04.831: E/CRASH(5102): r0 c355ec40 r1 c548f3b0 r2 be6f273d r3 0000148c 
    07-12 20:20:04.831: E/CRASH(5102): r4 c3e6f2f8 r5 c3e6f300 r6 00000000 r7 c3e6f300 
    07-12 20:20:04.832: E/CRASH(5102): r8 00000000 r9 c92e566c sl c087e110 fp c92e5140 
    07-12 20:20:04.832: E/CRASH(5102): ip be7b1e2c sp c92e50f8 lr be6f2747 pc c548f3b0 cpsr e85bad10 
    07-12 20:20:04.832: E/CRASH(5102): backtrace: 
    07-12 20:20:05.257: E/CRASH(5102): #00 pc 000ae3b0 [stack:5297] 
    07-12 20:20:05.258: E/CRASH(5102): #01 pc 000e0745 /data/app/com.google.FirebaseUnityAuthTestApp.dev-cAQmErusOAQBaqw_wlYwCg==/lib/arm/libFirebaseCppApp-6.2.1.so (firebase::auth::AuthNotifier::NotifyOnTheMainThread(firebase::auth::AuthNotifier::CallbackData*)+8) 
    07-12 20:20:05.258: E/CRASH(5102): #02 pc 00113555 /data/app/com.google.FirebaseUnityAuthTestApp.dev-cAQmErusOAQBaqw_wlYwCg==/lib/arm/libFirebaseCppApp-6.2.1.so (firebase::callback::CallbackEntry::Execute()+20) 
    07-12 20:20:05.258: E/CRASH(5102): #03 pc 001133f5 /data/app/com.google.FirebaseUnityAuthTestApp.dev-cAQmErusOAQBaqw_wlYwCg==/lib/arm/libFirebaseCppApp-6.2.1.so (firebase::callback::CallbackDispatcher::DispatchCallbacks()+36) 
    07-12 20:20:05.258: E/CRASH(5102): #04 pc 001133bd /data/app/com.google.FirebaseUnityAuthTestApp.dev-cAQmErusOAQBaqw_wlYwCg==/lib/arm/libFirebaseCppApp-6.2.1.so (firebase::callback::PollCallbacks()+24) 
    07-12 20:20:05.258: E/CRASH(5102): #05 pc 00e04e0c /data/app/com.google.FirebaseUnityAuthTestApp.dev-cAQmErusOAQBaqw_wlYwCg==/lib/arm/libil2cpp.so (AppUtilPINVOKE_PollCallbacks_m71D83CFC789866D288C270539FA18C20022D7E44+172) 
    07-12 20:20:05.258: E/CRASH(5102): #06 pc 00e04b58 /data/app/com.google.FirebaseUnityAuthTestApp.dev-cAQmErusOAQBaqw_wlYwCg==/lib/arm/libil2cpp.so (AppUtil_PollCallbacks_mADFB4BC7209554590C31E37F8C08562E463F9D59+380) 
    07-12 20:20:05.258: E/CRASH(5102): memory near r2: 
    07-12 20:20:05.258: E/CRASH(5102): be6f271c 44794a06 6809447a e9c03108 60821500 .JyDzD.h.1..... 
    07-12 20:20:05.258: E/CRASH(5102): be6f272c 40b0e8bd ba9af088 000bef4e 00000019 ...@....N....... 
    07-12 20:20:05.258: E/CRASH(5102): be6f273c 4604b510 68616800 b1244788 e8bd4620 ...F.hah.G$. F.. 
    07-12 20:20:05.258: E/CRASH(5102): be6f274c f0884010 bd10ba93 4604b5b0 4615480b .@.........F.H.F 
    07-12 20:20:05.258: E/CRASH(5102): be6f275c 44782200 30086800 0200e9c4 2202e9c4 ."xD.h.0......." 
    07-12 20:20:05.258: E/CRASH(5102): be6f276c f7e94608 e9c4e812 46200504 4605bdb0 .F........ F...F 
    07-12 20:20:05.258: E/CRASH(5102): be6f277c f7e94620 4628e816 fab0f083 000bef12 F....(F........ 
    07-12 20:20:05.258: E/CRASH(5102): be6f278c bcb4f088 f7e9b580 e8bde80c f0884080 .............@.. 
    07-12 20:20:05.259: E/CRASH(5102): be6f279c b580ba6d fe1af7fc 4080e8bd ba66f088 m..........@..f. 
    07-12 20:20:05.259: E/CRASH(5102): be6f27ac 6881b510 f7e94604 6820e802 60212100 ...h.F.... h.!! 
    07-12 20:20:05.259: E/CRASH(5102): be6f27bc f7e7b108 4620ef44 b5b0bd10 4605460c ....D. F.....F.F 
    07-12 20:20:05.259: E/CRASH(5102): be6f27cc 1000e9d0 1a426863 2a001a98 dd026060 ....chB....*.. 
    07-12 20:20:05.259: E/CRASH(5102): be6f27dc ee0cf7e8 68296860 68a06028 68696061 ....h)h(.haih 
    07-12 20:20:05.259: E/CRASH(5102): be6f27ec 68e06068 68a960a1 686060a8 602060e1 h.h..h.h. 
    07-12 20:20:05.259: E/CRASH(5102): be6f27fc 0000bdb0 b085b5f0 460d4604 68616800 .........F.F.hah 
    07-12 20:20:05.259: E/CRASH(5102): be6f280c 21011a0a 01a2eb01 4f80f1b1 68a6d221 ...!.......O!..h 
    07-12 20:20:05.259: E/CRASH(5102): memory near r3: 
    07-12 20:20:05.259: E/CRASH(5102): 0000146c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 0000147c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 0000148c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 0000149c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 000014ac ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 000014bc ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 000014cc ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 000014dc ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 000014ec ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 000014fc ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 0000150c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 0000151c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.260: E/CRASH(5102): 0000152c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.261: E/CRASH(5102): 0000153c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.261: E/CRASH(5102): 0000154c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.261: E/CRASH(5102): 0000155c ffffffff ffffffff ffffffff ffffffff ................ 
    07-12 20:20:05.261: E/CRASH(5102): memory near ip: 
    07-12 20:20:05.261: E/CRASH(5102): be7b1e0c be6ebac5 be6eb8bd be6ec199 be6ec25f ..n...n...n._.n. 
    07-12 20:20:05.261: E/CRASH(5102): be7b1e1c be7519f9 be6ec3a9 e9197d48 be6ec4a5 ..u...n.H}....n. 
    07-12 20:20:05.261: E/CRASH(5102): be7b1e2c e74eaf5b be6ec091 be751ced be7663b5 [.N...n...u..cv. 
    07-12 20:20:05.261: E/CRASH(5102): be7b1e3c be765f91 be751971 be6ec0b7 be75266d ._v.q.u...n.m&u. 
    07-12 20:20:05.261: E/CRASH(5102): be7b1e4c be6eb9df be6eba27 be6eba63 be765f65 ..n.'.n.c.n.e_v. 
    07-12 20:20:05.261: E/CRASH(5102): be7b1e5c e74b9f99 be6ebe65 be6ebea7 be6ebff1 ..K.e.n...n...n. 
    07-12 20:20:05.261: E/CRASH(5102): be7b1e6c be6ebf05 be6ebfa5 be6ec027 e74b9f8f ..n...n.'.n...K. 
    07-12 20:20:05.261: E/CRASH(5102): be7b1e7c be6ec115 be751275 be6ec2c9 be751371 ..n.u.u...n.q.u. 
    07-12 20:20:05.262: E/CRASH(5102): be7b1e8c be6ec535 e74eb1fd be6ec6dd be6ec6fd 5.n...N...n...n. 
    07-12 20:20:05.262: E/CRASH(5102): be7b1e9c be6ec87b be7287c9 be6ec8d1 be6ec915 {.n...r...n...n. 
    07-12 20:20:05.262: E/CRASH(5102): be7b1eac be6ec977 be6ea40b be6eca05 be6ecac3 w.n...n...n...n. 
    07-12 20:20:05.262: E/CRASH(5102): be7b1ebc be6ecbd1 be6ecbf1 be6eccb9 be6eccd9 ..n...n...n...n. 
    07-12 20:20:05.262: E/CRASH(5102): be7b1ecc be6ecbd1 be6ecf55 be6ed113 be6ed29d ..n.U.n...n...n. 
    07-12 20:20:05.262: E/CRASH(5102): be7b1edc be6ed3f5 be6ed5d1 be6ed6a5 be6eb9d1 ..n...n...n...n. 
    07-12 20:20:05.262: E/CRASH(5102): be7b1eec be6eb9f3 be6eb9f9 be6eb9ff be6eba0d ..n...n...n...n. 
    07-12 20:20:05.262: E/CRASH(5102): be7b1efc be6eba19 be6eba3b be6eba49 be6eba55 ..n.;.n.I.n.U.n. 
    07-12 20:20:05.262: E/CRASH(5102): code around pc: 
    07-12 20:20:05.262: E/CRASH(5102): c548f390 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.262: E/CRASH(5102): c548f3a0 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.262: E/CRASH(5102): c548f3b0 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.262: E/CRASH(5102): c548f3c0 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.262: E/CRASH(5102): c548f3d0 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f3e0 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f3f0 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f400 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f410 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f420 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f430 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f440 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f450 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f460 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f470 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): c548f480 00000000 00000000 00000000 00000000 ................ 
    07-12 20:20:05.263: E/CRASH(5102): code around lr: 
    07-12 20:20:05.263: E/CRASH(5102): be6f2724 e9c03108 60821500 40b0e8bd ba9af088 .1........@.... 
    07-12 20:20:05.264: E/CRASH(5102): be6f2734 000bef4e 00000019 4604b510 68616800 N..........F.hah 
    07-12 20:20:05.264: E/CRASH(5102): be6f2744 b1244788 e8bd4620 f0884010 bd10ba93 .G$. F...@...... 
    07-12 20:20:05.264: E/CRASH(5102): be6f2754 4604b5b0 4615480b 44782200 30086800 ...F.H.F."xD.h.0 
    07-12 20:20:05.264: E/CRASH(5102): be6f2764 0200e9c4 2202e9c4 f7e94608 e9c4e812 .......".F...... 
    07-12 20:20:05.264: E/CRASH(5102): be6f2774 46200504 4605bdb0 f7e94620 4628e816 .. F...F F....(F 
    07-12 20:20:05.264: E/CRASH(5102): be6f2784 fab0f083 000bef12 bcb4f088 f7e9b580 ................ 
    07-12 20:20:05.264: E/CRASH(5102): be6f2794 e8bde80c f0884080 b580ba6d fe1af7fc .....@..m....... 
    07-12 20:20:05.264: E/CRASH(5102): be6f27a4 4080e8bd ba66f088 6881b510 f7e94604 ...@..f....h.F.. 
    07-12 20:20:05.264: E/CRASH(5102): be6f27b4 6820e802 60212100 f7e7b108 4620ef44 .. h.!!....D. F 
    07-12 20:20:05.264: E/CRASH(5102): be6f27c4 b5b0bd10 4605460c 1000e9d0 1a426863 .....F.F....chB. 
    07-12 20:20:05.264: E/CRASH(5102): be6f27d4 2a001a98 dd026060 ee0cf7e8 68296860 ...*......h)h 
    07-12 20:20:05.264: E/CRASH(5102): be6f27e4 68a06028 68696061 68e06068 68a960a1 (.haihh.h.h 
    07-12 20:20:05.265: E/CRASH(5102): be6f27f4 686060a8 602060e1 0000bdb0 b085b5f0 .h. ........ 
    07-12 20:20:05.265: E/CRASH(5102): be6f2804 460d4604 68616800 21011a0a 01a2eb01 .F.F.hah...!.... 
    07-12 20:20:05.265: E/CRASH(5102): be6f2814 4f80f1b1 68a6d221 0308f104 10924f15 ...O!..h.....O.. 
    07-12 20:20:05.267: E/AndroidRuntime(5102): FATAL EXCEPTION: UnityMain 
    07-12 20:20:05.267: E/AndroidRuntime(5102): Process: com.google.FirebaseUnityAuthTestApp.dev, PID: 5102 
    07-12 20:20:05.267: E/AndroidRuntime(5102): java.lang.Error: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr c548f3b0 
    07-12 20:20:05.267: E/AndroidRuntime(5102): Build fingerprint: 'samsung/j7y17ltexx/j7y17lte:8.1.0/M1AJQ/J730FXXU3BRL3:user/release-keys' 
    07-12 20:20:05.267: E/AndroidRuntime(5102): Revision: '7' 
    07-12 20:20:05.267: E/AndroidRuntime(5102): pid: 5102, tid: 5260, name: UnityMain >>> com.google.FirebaseUnityAuthTestApp.dev <<< 
    07-12 20:20:05.267: E/AndroidRuntime(5102): r0 c355ec40 r1 c548f3b0 r2 be6f273d r3 0000148c 
    07-12 20:20:05.267: E/AndroidRuntime(5102): r4 c3e6f2f8 r5 c3e6f300 r6 00000000 r7 c3e6f300 
    07-12 20:20:05.267: E/AndroidRuntime(5102): r8 00000000 r9 c92e566c sl c087e110 fp c92e5140 
    07-12 20:20:05.267: E/AndroidRuntime(5102): ip be7b1e2c sp c92e50f8 lr be6f2747 pc c548f3b0 cpsr e85bad10 
    07-12 20:20:05.267: E/AndroidRuntime(5102): at [stack:5297].000ae3b0(Native Method) 
    07-12 20:20:05.267: E/AndroidRuntime(5102): at libFirebaseCppApp-6.firebase::auth::AuthNotifier::NotifyOnTheMainThread(firebase::auth::AuthNotifier::CallbackData*)(auth:8) 
    07-12 20:20:05.267: E/AndroidRuntime(5102): at libFirebaseCppApp-6.firebase::callback::CallbackEntry::Execute()(callback:20) 
    07-12 20:20:05.267: E/AndroidRuntime(5102): at libFirebaseCppApp-6.firebase::callback::CallbackDispatcher::DispatchCallbacks()(callback:36) 
    07-12 20:20:05.267: E/AndroidRuntime(5102): at libFirebaseCppApp-6.firebase::callback::PollCallbacks()(callback:24) 
    07-12 20:20:05.267: E/AndroidRuntime(5102): at libil2cpp.AppUtilPINVOKE_PollCallbacks_m71D83CFC789866D288C270539FA18C20022D7E44(AppUtilPINVOKE_PollCallbacks_m71D83CFC789866D288C270539FA18C20022D7E44:172) 
    07-12 20:20:05.267: E/AndroidRuntime(5102): at libil2cpp.AppUtil_PollCallbacks_mADFB4BC7209554590C31E37F8C08562E463F9D59(AppUtil_PollCallbacks_mADFB4BC7209554590C31E37F8C08562E463F9D59:380)

Please answer the following, if applicable:

The problem appear in my app.
Then I tried to build a small app which only contain the firebase functionality from my original app and got the same crash.
Lastly I tried with the test app from "Firebase-Test" apps and got the same.

@mantoun1984 mantoun1984 added the new New issue. label Jul 12, 2019
@amoswazana
Copy link

amoswazana commented Jul 16, 2019

Same issue here. This is holding up our next app version, would love to hear if there are any updates.

Unity editor version: 2019.1.4f1
Firebase Unity SDK version: 6.2.0, 6.1.1
Firebase plugins in use (Auth, Database, etc.): Auth, Messaging, Database, Functions, Analytics, Dynamic Links
Additional SDKs you are using (Facebook, AdMob, etc.): Facebook, AdMob, UnityPurchasing, Photon, Google Play Games
Platform you are using the Unity editor on (Mac, Windows, or Linux): Mac
Platform you are targeting (iOS, Android, and/or desktop): Android

LOGCAT Device 1 (Samsung J7):

2019-07-16 11:49:32.409 31112-31521/? E/CRASH: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr c343cce4
2019-07-16 11:49:32.409 31112-31521/? E/CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-07-16 11:49:32.409 31112-31521/? E/CRASH: Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
2019-07-16 11:49:32.409 31112-31521/? E/CRASH: Build fingerprint: 'samsung/j7xeltexx/j7xelte:7.0/NRD90M/J710FXXU5BRC2:user/release-keys'
2019-07-16 11:49:32.409 31112-31521/? E/CRASH: Revision: '7'
2019-07-16 11:49:32.413 3527-3527/? E/audit: type=1701 audit(1563266972.401:3828): auid=4294967295 uid=10532 gid=10532 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=31521 comm="UnityMain" exe="/system/bin/app_process32" sig=11

LOGCAT Device 2 (Nexus 5X)

2019-07-16 11:55:21.155 22422-23031/? E/CRASH: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0000007c9da0a874
2019-07-16 11:55:21.155 22422-23031/? E/CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-07-16 11:55:21.155 22422-23031/? E/CRASH: Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
2019-07-16 11:55:21.155 22422-23031/? E/CRASH: Build fingerprint: 'google/bullhead/bullhead:8.1.0/OPM7.181205.001/5080180:user/release-keys'
2019-07-16 11:55:21.155 22422-23031/? E/CRASH: Revision: 'rev_1.0'
2019-07-16 11:55:21.155 22422-23031/? E/CRASH: pid: 22422, tid: 23031, name: UnityMain  >>> [bundle id here] <<<
2019-07-16 11:55:21.155 22422-23031/? E/CRASH:     x0   0000007ca029ddc0  x1   0000007c8d3040fc  x2   0000000000000000  x3   0000000000000002
2019-07-16 11:55:21.155 22422-23031/? E/CRASH:     x4   0000000000000117  x5   0000007c704173f8  x6   0000007c95231d00  x7   0000007c95231d00
2019-07-16 11:55:21.155 22422-23031/? E/CRASH:     x8   0000007c9da0a874  x9   bb3a8a3b6d7cbaec  x10  0000000000000000  x11  00000000000059f7
2019-07-16 11:55:21.156 22422-23031/? E/CRASH:     x12  0000007c96b27880  x13  0000000000000355  x14  0000000000000353  x15  0000007d3bbb4000
2019-07-16 11:55:21.156 22422-23031/? E/CRASH:     x16  0000007c8d3ea018  x17  0000007d3d4b571c  x18  0000007c7491d898  x19  0000007c989643d0
2019-07-16 11:55:21.156 22422-23031/? E/CRASH:     x20  0000007c989643e0  x21  0000000000000002  x22  0000007c989643e0  x23  0000000000000000
2019-07-16 11:55:21.156 22422-23031/? E/CRASH:     x24  0000000000000000  x25  0000000013ec0778  x26  0000000013ec19d8  x27  000000006f8a6e50
2019-07-16 11:55:21.156 22422-23031/? E/CRASH:     x28  0000000000000000  x29  0000007ca31b4100  x30  0000007c8d304110
2019-07-16 11:55:21.156 22422-23031/? E/CRASH:     sp   0000007ca31b4050  pc   0000007c9da0a874  pstate 0000000060000000
2019-07-16 11:55:21.156 22422-23031/? E/CRASH: backtrace:

@alexames
Copy link

Hi all, we're looking into this and I'll let you know when we have a fix.

@chkuang-g
Copy link
Contributor

@amoswazana
After a lot of testing and research, we think your crash may be related to a Unity regression.
https://forum.unity.com/threads/crashes-on-android-after-migrating-to-unity-2018-3-when-use-androidjavaproxy-class.627637/
https://issuetracker.unity3d.com/issues/android-app-crashes-when-invoking-java-proxy-while-the-app-is-in-the-background

I have verified the issue is fixed with Unity 2019.1.11f1 and 2018.3.14f1. Could you try to upgrade to latest Unity version and see if the crash is resolved?

@mantoun1984
Just curious, did you crash with the same call stack every time?
I cannot reproduce with the exact same call stack from my side. I just saw the one @amoswazana reported. Could try to upgrade your Unity and see if that fixes your issue?
Also I may have a fix for this in the next release. But I like to have more information to make sure the bug is actually fixed.

Thank you!
Shawn

@amoswazana
Copy link

amoswazana commented Jul 28, 2019

@amoswazana
After a lot of testing and research, we think your crash may be related to a Unity regression.
https://forum.unity.com/threads/crashes-on-android-after-migrating-to-unity-2018-3-when-use-androidjavaproxy-class.627637/
https://issuetracker.unity3d.com/issues/android-app-crashes-when-invoking-java-proxy-while-the-app-is-in-the-background

I have verified the issue is fixed with Unity 2019.1.11f1 and 2018.3.14f1. Could you try to upgrade to latest Unity version and see if the crash is resolved?

@chkuang-g Sorry this didn't help. Still seeing the same issue with Unity 2019.1.12f1.

On the Galaxy J7:

07-28 12:48:50.383 12863 13515 E CRASH   : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr c3fae1a0
07-28 12:48:50.383 12863 13515 E CRASH   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-28 12:48:50.383 12863 13515 E CRASH   : Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
07-28 12:48:50.383 12863 13515 E CRASH   : Build fingerprint: 'samsung/j7xeltexx/j7xelte:7.0/NRD90M/J710FXXU5BRC2:user/release-keys'
07-28 12:48:50.383 12863 13515 E CRASH   : Revision: '7'

And on the Nexus 5X:

07-28 12:54:05.609 20008 20381 E CRASH   : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0000007c9da0ce44
07-28 12:54:05.609 20008 20381 E CRASH   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-28 12:54:05.609 20008 20381 E CRASH   : Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
07-28 12:54:05.609 20008 20381 E CRASH   : Build fingerprint: 'google/bullhead/bullhead:8.1.0/OPM7.181205.001/5080180:user/release-keys'
07-28 12:54:05.610 20008 20381 E CRASH   : Revision: 'rev_1.0'
07-28 12:54:05.610 20008 20381 E CRASH   : pid: 20008, tid: 20381, name: UnityMain  >>> [bundle id here] <<<
07-28 12:54:05.610 20008 20381 E CRASH   :     x0   0000007ca050e780  x1   0000007c8f5040fc  x2   0000000000000000  x3   0000000000000002
07-28 12:54:05.610 20008 20381 E CRASH   :     x4   0000000000000056  x5   0000007c74c1c9b8  x6   0000007c9175a9a8  x7   0000007c9175a9a8
07-28 12:54:05.610 20008 20381 E CRASH   :     x8   0000007c9da0ce44  x9   bb3a8a3b6d7cbaec  x10  0000000000000000  x11  0000000000004f9d
07-28 12:54:05.610 20008 20381 E CRASH   :     x12  0000007ca0f65080  x13  000000000000021f  x14  000000000000021d  x15  0000007d3ceb3000
07-28 12:54:05.610 20008 20381 E CRASH   :     x16  0000007c8f5ea018  x17  0000007d3d4b571c  x18  0000007c77b23e78  x19  0000007ca0f4fdb0
07-28 12:54:05.610 20008 20381 E CRASH   :     x20  0000007ca0f4fdc0  x21  0000000000000002  x22  0000007ca0f4fdc0  x23  0000000000000000
07-28 12:54:05.610 20008 20381 E CRASH   :     x24  0000000000000000  x25  0000000013ac0138  x26  00000000132b6b78  x27  000000006f8a6e50
07-28 12:54:05.610 20008 20381 E CRASH   :     x28  0000000000000000  x29  0000007ca3c7d100  x30  0000007c8f504110
07-28 12:54:05.610 20008 20381 E CRASH   :     sp   0000007ca3c7d050  pc   0000007c9da0ce44  pstate 0000000060000000
07-28 12:54:05.610 20008 20381 E CRASH   : 
07-28 12:54:05.610 20008 20381 E CRASH   : backtrace:

Edited to add: Where did you see my issue in those links? At the end of the forum thread they started talking about the SIGSEGV error but no fixes were provided. The guy from Unity said it was unrelated even...

@mantoun1984
Copy link
Author

@chkuang-g
Yes, I'm getting the same stack trace each time.
and as @amoswazana mentioned, I still have the same crash even after update to 2019.1.11f1.|

The problem isn't solved.

@Wolar
Copy link

Wolar commented Jul 30, 2019

Same issue here on for example Galaxy S8, Unity 2019.1.10. We are using only Analytics and Remote Config.

Two notes that might help:

  • I was integrating Firebase into new project, so it might only appear on new/fresh installs / projects, not on updated ones.
  • We also use GoogleMobileAds (AdMob) I have already seen some issues that were caused by using AdMob and Firebase at the same time.

@ryanmeier
Copy link

@mantoun1984 We made some changes in the latest version of the SDK (6.2.2) that should hopefully fix the issues you're seeing. Could you try installing the latest SDK and let us know if that resolves your issue?

@Wolar
Copy link

Wolar commented Jul 31, 2019

@ryanmeier I'm using 6.2.2 and the problem is still there. What is strange, that I have downgraded to 6.0.0 which we are using on other our project without any problems and it doesn't work as well. But the other project is using Unity 2018.3, this one is using 2019.1.

@Wolar
Copy link

Wolar commented Jul 31, 2019

There is one workaround we have found which a) might help others workaround this b) might help you investigate where the problem is. The only downside is that your app won't have backup allowed.

Also if you install the app without this workaround, delete all it's data and cache and run it, it will work, but that's not a solution, just one more hint to help with pinpoint the issue.

Ok so how to workaround it:

  • We had to update to Unity 2019.1.12 (it didn't work on 2019.1.10)
  • Add this to you Manifest like in example bellow android:allowBackup=“false” tools:replace=“android:allowBackup”

<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:allowBackup="false" tools:replace="android:allowBackup" ...>

That should make it work

@amoswazana
Copy link

Any news on this issue?

@alexames
Copy link

Hi, this issue is resolved in the latest release of the SDK, version 6.3.0.

@amoswazana
Copy link

Sorry, this didn't fix the issue.
Firebase version 6.3.0
Unity version 2019.1.12.f1

Logcat is same as before:

08-15 16:00:25.469 30914 31190 E CRASH   : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr b68ad5f8
08-15 16:00:25.469 30914 31190 E CRASH   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-15 16:00:25.469 30914 31190 E CRASH   : Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
08-15 16:00:25.469 30914 31190 E CRASH   : Build fingerprint: 'samsung/j7xeltexx/j7xelte:7.0/NRD90M/J710FXXU5BRC2:user/release-keys'
08-15 16:00:25.469 30914 31190 E CRASH   : Revision: '7'

@utkarshparasarampuria
Copy link

I get a similar error with signal 11, code 1 on the latest SDK 6.3.0. I've added my log here:
#417 (comment)

@amoswazana
Copy link

@alexames Can you please reopen this issue... It hasn't been solved yet.

@patm1987 patm1987 reopened this Aug 19, 2019
@patm1987
Copy link

I'm sorry to hear that the issue is still happening. We'll look into it.

@stewartmiles
Copy link
Contributor

@amoswazana I've just tested this with the auth sample application by enabling a second FirebaseApp object (i.e when populating

private Firebase.AppOptions otherAuthOptions = new Firebase.AppOptions {
). It's possible to sign a user into both FirebaseApp objects, close the app, restart and everything works as expected.

Could you share our auth sample modified to reproduce the failure you're seeing?

@mantoun1984
Copy link
Author

mantoun1984 commented Aug 21, 2019

@stewartmiles
In my case you don't need to modify anything in your auth sample app. All you need to do is:

  • open the app
  • sign in anonymously
  • exit (hardware back button)
  • open the app again. Here you should the crash (with the same memory stack I've shared when I open this thread).

OR:

I found that I can reproduce the crash by:

  • open the app
  • exit (hardware back button)
  • open the app again
  • sign in anonymously

Unity editor version: 2019.1.12f1
Firebase Unity SDK version: 6.3.0
Firebase plugins in use (Auth, Database, etc.): Auth
Additional SDKs you are using (Facebook, AdMob, etc.): nothing
Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows
Platform you are targeting (iOS, Android, and/or desktop): Android

08-21 20:41:49.735: E/CRASH(26272): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr cd990398 08-21 20:41:49.735: E/CRASH(26272): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 08-21 20:41:49.735: E/CRASH(26272): Build type 'Development', Scripting Backend 'il2cpp', CPU 'armeabi-v7a' 08-21 20:41:49.735: E/CRASH(26272): Build fingerprint: 'samsung/j7y17ltexx/j7y17lte:9/PPR1.180610.011/J730FXXU4CSF1:user/release-keys' 08-21 20:41:49.735: E/CRASH(26272): Revision: '7' 08-21 20:41:49.735: E/CRASH(26272): pid: 26272, tid: 26591, name: UnityMain >>> com.google.FirebaseUnityAuthTestApp.dev <<< 08-21 20:41:49.735: E/CRASH(26272): r0 c8bbdc20 r1 cd990398 r2 00000000 r3 00000000 08-21 20:41:49.735: E/CRASH(26272): r4 cffeb0c0 r5 ec1fc230 r6 00000000 r7 ec1fc230 08-21 20:41:49.735: E/CRASH(26272): r8 00000000 r9 cffeb63c sl c9a90110 fp cffeb110 08-21 20:41:49.736: E/CRASH(26272): ip c5a78e94 sp cffeb0b0 lr c59b8d85 pc cd990398 cpsr ee4b3d10 08-21 20:41:49.736: E/CRASH(26272): backtrace: 08-21 20:41:50.123: E/CRASH(26272): #00 pc 00011398 [stack:26610] 08-21 20:41:50.123: E/CRASH(26272): #01 pc 000e0d83 /data/app/com.google.FirebaseUnityAuthTestApp.dev-DY9VzeXrw5EJ99EDtu4Lxw==/lib/arm/libFirebaseCppApp-6_3_0.so (firebase::auth::AuthNotifier::NotifyOnTheMainThread(firebase::SharedPtr<firebase::auth::AuthNotifier::CallbackData>)+38) 08-21 20:41:50.123: E/CRASH(26272): #02 pc 000e0def /data/app/com.google.FirebaseUnityAuthTestApp.dev-DY9VzeXrw5EJ99EDtu4Lxw==/lib/arm/libFirebaseCppApp-6_3_0.so (firebase::callback::CallbackValue1<firebase::SharedPtr<firebase::auth::AuthNotifier::CallbackData> >::Run()+44) 08-21 20:41:50.123: E/CRASH(26272): code around pc: 08-21 20:41:50.123: E/CRASH(26272): cd990378 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.123: E/CRASH(26272): cd990388 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.124: E/CRASH(26272): cd990398 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.124: E/CRASH(26272): cd9903a8 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.124: E/CRASH(26272): cd9903b8 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.124: E/CRASH(26272): cd9903c8 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.124: E/CRASH(26272): cd9903d8 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.124: E/CRASH(26272): cd9903e8 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.124: E/CRASH(26272): cd9903f8 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.124: E/CRASH(26272): cd990408 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.124: E/CRASH(26272): cd990418 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.125: E/CRASH(26272): cd990428 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.125: E/CRASH(26272): cd990438 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.125: E/CRASH(26272): cd990448 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.125: E/CRASH(26272): cd990458 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.125: E/CRASH(26272): cd990468 00000000 00000000 00000000 00000000 ................ 08-21 20:41:50.125: E/CRASH(26272): code around lr: 08-21 20:41:50.125: E/CRASH(26272): c59b8d64 90016800 ff64f7f8 68816820 2100b149 .h....d. h.hI..! 08-21 20:41:50.125: E/CRASH(26272): c59b8d74 a8016081 ff52f7f8 e9d16821 47880100 .....R.!h.....G 08-21 20:41:50.125: E/CRASH(26272): c59b8d84 a801bd1c ff4af7f8 bf00bd1c 000bf902 ......J......... 08-21 20:41:50.125: E/CRASH(26272): c59b8d94 4604b510 44784805 f1006800 46200108 ...F.HxD.h.... F 08-21 20:41:50.125: E/CRASH(26272): c59b8da4 f7e8c002 4620eeb2 bf00bd10 000bf8ce ...... F........ 08-21 20:41:50.125: E/CRASH(26272): c59b8db4 f7ffb580 e8bdffed f0884080 b51cbd83 .........@...... 08-21 20:41:50.126: E/CRASH(26272): c59b8dc4 3201e9d0 2b0068c1 3200e9cd f3bfd00c ...2.h.+...2.... 08-21 20:41:50.126: E/CRASH(26272): c59b8dd4 e8d28f5b 3001037f 0300f143 0374e8c2 [......0C.....t. 08-21 20:41:50.126: E/CRASH(26272): c59b8de4 d1f62c00 8f5bf3bf 47884668 f7e84668 .,....[.hF.GhF.. 08-21 20:41:50.126: E/CRASH(26272): c59b8df4 bd1cee8c 46684604 ee86f7e8 f0834620 .....FhF.... F.. 08-21 20:41:50.126: E/CRASH(26272): c59b8e04 0000fd99 4604b5b0 2300480a 68004478 .......F.H.#xD.h 08-21 20:41:50.126: E/CRASH(26272): c59b8e14 e9c43008 e9c40300 f1043302 f7ff0010 .0.......3...... 08-21 20:41:50.126: E/CRASH(26272): c59b8e24 4620fe37 4605bdb0 f7e84620 4628ee92 7. F...F F....(F 08-21 20:41:50.126: E/CRASH(26272): c59b8e34 fd80f083 000bf85c 4604b510 44784807 ....\......F.HxD 08-21 20:41:50.126: E/CRASH(26272): c59b8e44 f1006800 46200108 1b10f840 ff1cf7ff .h.... F@....... 08-21 20:41:50.127: E/CRASH(26272): c59b8e54 e8bd4620 f0884010 bf00bf7d 000bf82a F...@..}...*... 08-21 20:41:50.129: E/AndroidRuntime(26272): FATAL EXCEPTION: UnityMain 08-21 20:41:50.129: E/AndroidRuntime(26272): Process: com.google.FirebaseUnityAuthTestApp.dev, PID: 26272 08-21 20:41:50.129: E/AndroidRuntime(26272): java.lang.Error: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr cd990398 08-21 20:41:50.129: E/AndroidRuntime(26272): Build fingerprint: 'samsung/j7y17ltexx/j7y17lte:9/PPR1.180610.011/J730FXXU4CSF1:user/release-keys' 08-21 20:41:50.129: E/AndroidRuntime(26272): Revision: '7' 08-21 20:41:50.129: E/AndroidRuntime(26272): pid: 26272, tid: 26591, name: UnityMain >>> com.google.FirebaseUnityAuthTestApp.dev <<< 08-21 20:41:50.129: E/AndroidRuntime(26272): r0 c8bbdc20 r1 cd990398 r2 00000000 r3 00000000 08-21 20:41:50.129: E/AndroidRuntime(26272): r4 cffeb0c0 r5 ec1fc230 r6 00000000 r7 ec1fc230 08-21 20:41:50.129: E/AndroidRuntime(26272): r8 00000000 r9 cffeb63c sl c9a90110 fp cffeb110 08-21 20:41:50.129: E/AndroidRuntime(26272): ip c5a78e94 sp cffeb0b0 lr c59b8d85 pc cd990398 cpsr ee4b3d10 08-21 20:41:50.129: E/AndroidRuntime(26272): at [stack:26610].00011398(Native Method) 08-21 20:41:50.129: E/AndroidRuntime(26272): at libFirebaseCppApp-6_3_0.firebase::auth::AuthNotifier::NotifyOnTheMainThread(firebase::SharedPtr<firebase::auth::AuthNotifier::CallbackData>)(auth:38) 08-21 20:41:50.129: E/AndroidRuntime(26272): at libFirebaseCppApp-6_3_0.firebase::callback::CallbackValue1<firebase::SharedPtr<firebase::auth::AuthNotifier::CallbackData> >::Run()(callback:44)

@USPTech
Copy link

USPTech commented Aug 22, 2019

Can confirm this issue is there with Firebase 6.3.0.
Frameworks used in app (Facebook, Audience Network, AdMob, Chocolate)

Log:

`08-22 13:59:45.184 2104-2177/? E/AndroidRuntime: FATAL EXCEPTION: UnityMain
Process: com.tinmen.ludoboss, PID: 2104
java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 002d746f6f601118
Build fingerprint: 'HONOR/LLD-AL10/HWLLD-H:9/HONORLLD-AL10/122C675R1:user/release-keys'
Revision: '0'
pid: 2104, tid: 2187, name: Thread-220 >>> com.tinmen.ludoboss <<<
x0 00000072dc186f08 x1 652d746f6f622f6b x2 00000072d9d97000 x3 0000000000000000
x4 00000000000000b4 x5 00000000716bec6a x6 000000006f823298 x7 7f7f7f7f7f7f7f7f
x8 652d746f6f6000a0 x9 0000000000000014 x10 0000000000000022 x11 0000000000000000
x12 0000000000028ba4 x13 0000000000000000 x14 0000000000028ba3 x15 00000072fb505000
x16 0000007381232bd8 x17 00000073811c6cf0 x18 00000072fb2cf450 x19 00000072d9d97000
x20 652d746f6f622f6b x21 00000072dc186f08 x22 0000000000000000 x23 000000738123ec20
x24 000000738123ec9c x25 0000000000000001 x26 00000072bd2b8b00 x27 0000000000000002
x28 00000072deef73f0 x29 00000072da5e11e0 x30 00000073811e3e88
sp 00000072da5e11b0 pc 00000073811e38fc pstate 0000000080000000

    at [vdso].(:0)
    at libc.ifree(ifree:84)
    at libc.je_free(je_free:120)
    at libFirebaseCppApp-6_3_0._ZN8firebase9messaging12NotificationD2Ev(_ZN8firebase9messaging12NotificationD2Ev:24)
    at libFirebaseCppApp-6_3_0._ZN8firebase9messaging7MessageD2Ev(_ZN8firebase9messaging7MessageD2Ev:24)
    at libFirebaseCppApp-6_3_0.Firebase_Messaging_CSharp_delete_FirebaseMessage(Firebase_Messaging_CSharp_delete_FirebaseMessage:12)
    at libil2cpp.(:0)
    at libil2cpp.(:0)
    at libil2cpp.(:0)
    at libil2cpp.(:0)
    at libil2cpp.(:0)
    at libil2cpp.(:0)
    at libil2cpp.(:0)
    at libil2cpp.(:0)
    at libil2cpp.(:0)
    at libil2cpp.(:0)
    at libc._ZL15__pthread_startPv(_ZL15__pthread_startPv:36)
    at libc.__start_thread(__start_thread:68)

08-22 13:59:45.189 1249-13652/? W/ActivityManager: finishTopCrashedActivityLocked Force finishing activity com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity
08-22 13:59:45.200 1249-1270/? I/StatusBarDisable: setFlags what=0 which=1 pkg=Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity}
08-22 13:59:45.460 1249-1381/? W/InputDispatcher: channel '8e27e51 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
08-22 13:59:45.460 1249-1381/? E/InputDispatcher: channel '8e27e51 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
08-22 13:59:45.463 1249-6018/? I/WindowManager: WIN DEATH: Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity}
08-22 13:59:45.463 1249-6018/? V/WindowManager: removeIfPossible: Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity}
08-22 13:59:45.463 1249-6018/? W/InputDispatcher: Attempted to unregister already unregistered input channel '8e27e51 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity (server)'
08-22 13:59:45.468 1249-6018/? V/WindowManager: Not removing Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity EXITING} due to exit animation
08-22 13:59:45.471 1249-1270/? I/StatusBarDisable: setFlags what=0 which=1 pkg=Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity EXITING}
08-22 13:59:45.474 1249-1270/? I/StatusBarDisable: setFlags what=0 which=1 pkg=Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity EXITING}
08-22 13:59:45.488 1249-1270/? I/StatusBarDisable: setFlags what=0 which=1 pkg=Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity EXITING}
08-22 13:59:45.506 1249-6298/? V/WindowManager: Exit animation finished in Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity EXITING}: remove=true
08-22 13:59:45.507 1249-6298/? E/WindowManager: win=Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true
08-22 13:59:45.508 1249-6298/? W/WindowManager: Exception thrown when updateSurfaceStatusSurface(name=com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity)/@0x713c22b: android.os.DeadObjectException
08-22 13:59:45.509 1249-6298/? V/WindowManager: postWindowRemoveCleanupLocked: Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity}
Removing Window{8e27e51 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity} from AppWindowToken{e29770b token=Token{40db6da ActivityRecord{c44e885 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity t2628}}}
08-22 13:59:45.519 1249-6298/? V/WindowManager: removeAppToken: AppWindowToken{e29770b token=Token{40db6da ActivityRecord{c44e885 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity t2628}}} delayed=true Callers=com.android.server.wm.DisplayContent.removeAppToken:1086 com.android.server.wm.AppWindowContainerController.removeContainer:315 com.android.server.am.ActivityRecord.removeWindowContainer:1200 com.android.server.am.ActivityStack.removeActivityFromHistoryLocked:4563
08-22 13:59:45.542 1249-6298/? W/HwActivityManagerServiceEx: setResumedActivityUncheckLocked start call, from: ActivityRecord{c44e885 u0 com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity t-1 f}, to: ActivityRecord{b459365 u0 com.huawei.android.launcher/.unihome.UniHomeLauncher t1}
appSwitch from: com.tinmen.ludoboss to: com.huawei.android.launcher
08-22 13:59:45.579 17206-18214/? E/DollieAdapterService: notifyActivityState pkg:com.tinmen.ludoboss/com.google.firebase.MessagingUnityPlayerActivity state:18 fg:false mUid:11184
`

@stewartmiles
Copy link
Contributor

@mantoun1984 and @USPTech this is a different bug than what was originally reported. We'll take a look.

@stewartmiles
Copy link
Contributor

@USPTech the bug you've reported is not associated with this issue. The stack trace points at FirebaseMessaging.

@USPTech
Copy link

USPTech commented Aug 29, 2019

There is one workaround we have found which a) might help others workaround this b) might help you investigate where the problem is. The only downside is that your app won't have backup allowed.

Also if you install the app without this workaround, delete all it's data and cache and run it, it will work, but that's not a solution, just one more hint to help with pinpoint the issue.

Ok so how to workaround it:

  • We had to update to Unity 2019.1.12 (it didn't work on 2019.1.10)
  • Add this to you Manifest like in example bellow android:allowBackup=“false” tools:replace=“android:allowBackup”

<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:allowBackup="false" tools:replace="android:allowBackup" ...>

That should make it work

@stewartmiles That may be true but this temporarily fixes the problem.

@ColorTwist
Copy link

ColorTwist commented Aug 30, 2019

With android:allowBackup="false" I did manage to compile the apk while before I received the error mentioned here using firebase SDK 6.4.
Note that strangely APP would compile with Build App Bundle (For google play) without using the 'allowbackup'

Using unity 2019.1.11

Actually, when thinking about it, I do not even know what android:allowBackup="false" does.

@nextvern
Copy link

nextvern commented Sep 6, 2019

Try this if the scripting backend "IL2CPP"

Firebase.FirebaseApp.DefaultInstance.Dispose();
Application.Quit();

@stewartmiles
Copy link
Contributor

We think this is fixed in 6.5.0 https://firebase.google.com/support/release-notes/unity#version_650_-_september_10_2019

@chkuang-g
Copy link
Contributor

chkuang-g commented Oct 1, 2019

Hi folks,

Just give you an update on this issue. 6.5.0 may not fully resolve the issue due to an Unity bug, which is fixed in Unity 2019.2.
https://issuetracker.unity3d.com/issues/android-application-dot-quit-and-application-dot-unload-crashes-the-app-on-android-9-dot-x-devices-when-scripting-backend-is-set-to-il2cpp

We noticed that Auth unity testapp may still crash with the following configuration.

  • Use any version before 2019.2. (we tested with 2018.3.2f1 and 2019.1.11f1)
  • Build Android build with IL2CPP (Mono works fine)
  • Install the app on device with Android 9 (Android 10 seems work fine).
  • Use Application.Quit() to exit the app, relaunch again and call any FirebaseAuth API.

What happen is: if the app is killed, usually through Overview screen (Recent button), every thing is fine. However, if the app exits by UnityEngine.Application.Quit(), C++ library may not be unloaded. What made it worse is that all the C# object will not be finalize properly either. As a result, when the app is launched for the second time, the Unity SDK would access C++ library in a stale state, and may crash if some function access invalid memory address, which is freed from the previous session.

We are still trying to find the root cause and potential patch to work-around with this issue. At the meantime, if you are experiencing the same issue, here are some work-around you can do.

  • Use new AndroidJavaClass("java.lang.System").CallStatic("exit", 0); instead of Application.Quit().
    However, all your OnApplicationQuit() implemented in MonoBehavior will not be triggered, since you kill the process directly. You should make sure that you don't need to do anything after this call.
  • Dispose FirebaseApp in OnApplicationQuit()
    The only thing you should be aware of is: Unity does not guarantee the order when OnApplicationQuit() of each object is called. Make sure not to use other Firebase APIs in other OnApplicationQuit() you implemented.

Let us know if this issue still plague you and will keep you update when the patch is ready.

Shawn

@eduardocoelho
Copy link

Same issue here. The crash intermittently occurs at app startup:

10-19 10:09:05.466 11692 11717 E AndroidRuntime: FATAL EXCEPTION: UnityMain
10-19 10:09:05.466 11692 11717 E AndroidRuntime: Process: mobi.redstonegames.crossword.en, PID: 11692
10-19 10:09:05.466 11692 11717 E AndroidRuntime: java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 000000725f1a12b0
10-19 10:09:05.466 11692 11717 E AndroidRuntime: Build fingerprint: 'motorola/evert_nt/evert_nt:9/PPWS29.116-16-11/5a67c:user/release-keys'
10-19 10:09:05.466 11692 11717 E AndroidRuntime: Revision: 'pvt1'
10-19 10:09:05.466 11692 11717 E AndroidRuntime: pid: 11692, tid: 11717, name: UnityMain  >>> mobi.redstonegames.crossword.en <<<
10-19 10:09:05.466 11692 11717 E AndroidRuntime:     x0   0000007269bdd658  x1   0000007266be6320  x2   0000007269a00000  x3   0000007269bda480
10-19 10:09:05.466 11692 11717 E AndroidRuntime:     x4   0000007269bc69c0  x5   0000007269bda500  x6   0000007266673710  x7   0000007266be6320
10-19 10:09:05.466 11692 11717 E AndroidRuntime:     x8   ffffffffff0b0b0c  x9   0000007266c1ba50  x10  00000000005f15a0  x11  0000000000007fff
10-19 10:09:05.466 11692 11717 E AndroidRuntime:     x12  0000000000000025  x13  0000007266be6320  x14  0000000000000100  x15  aaaaaaaaaaaaaaab
10-19 10:09:05.466 11692 11717 E AndroidRuntime:     x16  00000073073b01f0  x17  00000073072deb30  x18  0000007268207070  x19  000000726bafcda0
10-19 10:09:05.466 11692 11717 E AndroidRuntime:     x20  000000726494f698  x21  0000007266e6d000  x22  0000007266bdbf10  x23  0000007266e6d000
10-19 10:09:05.466 11692 11717 E AndroidRuntime:     x24  0000007266e6d000  x25  0000007266e6d000  x26  000000000000000b  x27  000000726494f694
10-19 10:09:05.466 11692 11717 E AndroidRuntime:     x28  000000000000162d  x29  000000726bafce20  x30  0000007265951344
10-19 10:09:05.466 11692 11717 E AndroidRuntime:     sp   000000726bafcd90  pc   0000007265951330  pstate 0000000080000000
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at [vdso].(:0)
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at split_config.(:0)
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at split_config.(:0)
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at split_config.(:0)
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at split_config.(:0)
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at split_config.(:0)
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at split_config.(:0)
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at split_config.(:0)
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at split_config.(:0)
10-19 10:09:05.466 11692 11717 E AndroidRuntime: 	at base.(:0)

I'm using Firebase Unity SDK 6.6.0, only with with Firebase Analytics (firebase-analytics:17.2.0).
Unity 2019.1.8f1

Unable to submit my game to GooglePlay because of this crash.

@patm1987
Copy link

For clarity, do any of the steps suggested by @chkuang-g resolve the issue? If not, can you elaborate on which ones you tried so we can get a better handle on your issue?

Thanks,
--Patrick

@Kezzo
Copy link

Kezzo commented Oct 23, 2019

I can confirm that the suggestion from @nextvern and @chkuang-g to Dispose() the FirebaseApp before OnApplicationQuit() does resolve the issue!
This was confirmed with Unity 2018.4.2f1 and 2019.2.1f1 and Firebase 6.1.1.

@patm1987
Copy link

Awesome, thanks!

We are aware of this issue and tracking it, and will update this thread when it's fixed. If the steps above do not help, definitely let us know (similar for @eduardocoelho).

@eduardocoelho
Copy link

eduardocoelho commented Oct 23, 2019

Hi,
I'm not sure the OnApplicationQuit() would make sense in my scenario.
I performed the following steps to reproduce the crash:

  1. Go to Settings App, choose My App and Select "Clear Cache", "Clear Data" and "Uninstall" options.
  2. Restart the device.
  3. Download My App from the Google Play (Beta channel).
  4. Open My App.
  5. Crash

Please note that the app crashes in the first launch.


EDIT:

I performed a 'Build and Run' directly from Unity on my Mac, and I got the following messages on logcat (hopefully they are more helpful):

10-23 17:14:52.992 25412 25412 F DEBUG   : Build fingerprint: 'samsung/gts3llteub/gts3llte:9/PPR1.180610.011/T825UBU3CSH7:user/release-keys'
10-23 17:14:52.992 25412 25412 F DEBUG   : Revision: '5'
10-23 17:14:52.992 25412 25412 F DEBUG   : ABI: 'arm64'
10-23 17:14:52.992 25412 25412 F DEBUG   : pid: 25316, tid: 25367, name: UnityMain  >>> mobi.redstonegames.crossword.en <<<
10-23 17:14:52.994  2480  3067 I SamsungAlarmManager: setLocked to kernel - T:2 / 20191023T171531, SetElapsed=3468524, nowELAPSED=3429800
10-23 17:14:52.994  2480  3067 I SamsungAlarmManager: setLocked to kernel - T:3 / 20191023T171500, SetElapsed=3436806, nowELAPSED=3429800
10-23 17:14:52.994 25412 25412 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
10-23 17:14:52.994 25412 25412 F DEBUG   : Abort message: 'Invalid address 0x7ceb8f9ca0 passed to free: value not allocated'
10-23 17:14:52.997 25412 25412 F DEBUG   :     x0  0000000000000000  x1  0000000000006317  x2  0000000000000006  x3  0000000000000008
10-23 17:14:52.997 25412 25412 F DEBUG   :     x4  8080808080808080  x5  8080808080808080  x6  8080808080808080  x7  0000000000000008
10-23 17:14:52.997 25412 25412 F DEBUG   :     x8  0000000000000083  x9  36a89ce8d9f8afd4  x10 fffffff87ffffbdf  x11 36a89ce8d9f8afd4
10-23 17:14:52.997 25412 25412 F DEBUG   :     x12 36a89ce8d9f8afd4  x13 fffffff87ffffbdf  x14 000000005db0a6ac  x15 0000000000000008
10-23 17:14:52.997 25412 25412 F DEBUG   :     x16 0000007cec8a32a0  x17 0000007cec7b4540  x18 36a89ce8d9f8afd4  x19 00000000000062e4
10-23 17:14:52.997 25412 25412 F DEBUG   :     x20 0000000000006317  x21 0000000000000083  x22 00000000000f9ca0  x23 0000007cec8af968
10-23 17:14:52.997 25412 25412 F DEBUG   :     x24 0000007c511323c9  x25 0000007c5112983d  x26 0000007c513ff000  x27 000000000000000b
10-23 17:14:52.998 25412 25412 F DEBUG   :     x28 000000626940b170  x29 0000007ceb8fad80
10-23 17:14:52.998 25412 25412 F DEBUG   :     sp  0000007ceb8fad40  lr  0000007cec7a674c  pc  0000007cec7a676c
10-23 17:14:52.999 25347 25411 D SamsungAnalytics201007: [DLC Sender] send result success : 0
10-23 17:14:53.009 25316 25382 W es.crossword.e: 0xebadde09 skipped times: 0
10-23 17:14:53.009 25316 25382 E CRASH   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000007e2d42f638
10-23 17:14:53.009 25316 25382 E CRASH   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-23 17:14:53.009 25316 25382 E CRASH   : Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
10-23 17:14:53.009 25316 25382 E CRASH   : Build fingerprint: 'samsung/gts3llteub/gts3llte:9/PPR1.180610.011/T825UBU3CSH7:user/release-keys'
10-23 17:14:53.009 25316 25382 E CRASH   : Revision: '5'
10-23 17:14:53.009 25316 25382 E CRASH   : pid: 25316, tid: 25382, name: firebase-iid-ex  >>> mobi.redstonegames.crossword.en <<<
10-23 17:14:53.009 25316 25382 E CRASH   :     x0   0000000000000001  x1   0000000000000001  x2   0000000012dc0288  x3   0000007c51664b20
10-23 17:14:53.009 25316 25382 E CRASH   :     x4   0000000000000007  x5   0000007c51664ac0  x6   0000000000003d90  x7   0000000000000020
10-23 17:14:53.009 25316 25382 E CRASH   :     x8   0000007e2d42f634  x9   0000000000000010  x10  00000000506cd589  x11  00000000506cd589
10-23 17:14:53.009 25316 25382 E CRASH   :     x12  0000000000000067  x13  0000000012dc028a  x14  0000007c61867c00  x15  0000000000000000
10-23 17:14:53.009 25316 25382 E CRASH   :     x16  0000007cecc73290  x17  0000007cecc1dca4  x18  0000000000000017  x19  0000007c63b9ba20
10-23 17:14:53.009 25316 25382 E CRASH   :     x20  0000007c51664b20  x21  0000000012dc0288  x22  0000000000000001  x23  0000000000000001
10-23 17:14:53.009 25316 25382 E CRASH   :     x24  0000000000000043  x25  0000007c51666588  x26  0000000000000043  x27  0000007c6a123c48
10-23 17:14:53.009 25316 25382 E CRASH   :     x28  0000007c6a054141  x29  0000007c51664b00  x30  0000007c69e6c6dc
10-23 17:14:53.009 25316 25382 E CRASH   :     sp   0000007c51664960  pc   0000007c69d230e8  pstate 0000000020000000
10-23 17:14:53.009 25316 25382 E CRASH   : 
10-23 17:14:53.009 25316 25382 E CRASH   : backtrace:

There are no related messages after the 10-23 17:14:53.009 25316 25382 E CRASH : backtrace: line.

Thanks in advance.

@patm1987
Copy link

Hi @eduardocoelho,

Given this information, would you mind filing a new issue? Since it isn't exactly the second run (ie: it doesn't sound like a long running native process is the cause of your issue), it's likely that the a fix to the OP won't fix the issue you're having and I'd hate for it to be lost.

Make sure that you do fill out the bug template, and eel free to reference this issue if you think it will help. Make sure you copy over the stack trace and repo steps when filing the new one.

Thanks,
--Patrick

@eduardocoelho
Copy link

eduardocoelho commented Oct 28, 2019

Hi @patm1987, despite the

pid: 25316, tid: 25382, name: firebase-iid-ex >>> mobi.redstonegames.crossword.en <<<

line, I think the issue is related to a bug in the Unity editor.

I downloaded Unity 2019.2.10f1, rebuilt the game and tried to reproduce it (via USB and Google Play Beta) and apparently the issue went away.

I'll fill a new issue in case the problem persists.

Thanks

@tzmm
Copy link

tzmm commented Nov 25, 2019

Additional info:

We're still seeing this hang after adding the dispose() call in Application.Quit() while using Unity 2018.4.12 with Firebase 6.7.0 (messaging + analytics), although we estimate the hang rate to be around 5%.

Repro steps are to manually kill the app on Android in the task manager, and relaunch the app.

We've managed to catch the crash in Visual Studio by manually breaking, and via logging, and for us it occurs during Firebase startup, when we ask for FirebaseApp.defaultInstance.

Here's the callstack we get in VS when the hang has occured:

Boolean Firebase.Dispatcher:Run (Func1)+0x72 at Z:\tmp\tmp.F8p3MkFCwk\firebase\app\client\unity\src\Platform\Dispatcher.cs:60 C# Boolean Firebase.Platform.FirebaseHandler:RunOnMainThread (Func1)+0x10 at Z:\tmp\tmp.F8p3MkFCwk\firebase\app\client\unity\src\Unity\FirebaseHandler.cs:115 C#
FirebaseApp Firebase.FirebaseApp:CreateAndTrack (CreateDelegate, FirebaseApp)+0x21b at Z:\tmp\tmp.lXcxlNDCDB\firebase\app\client\unity\proxy\FirebaseApp.cs:619 C#
FirebaseApp Firebase.FirebaseApp:Create ()+0x27 at Z:\tmp\tmp.lXcxlNDCDB\firebase\app\client\unity\proxy\FirebaseApp.cs:119 C#
FirebaseApp Firebase.FirebaseApp:get_DefaultInstance ()+0x17 at Z:\tmp\tmp.lXcxlNDCDB\firebase\app\client\unity\proxy\FirebaseApp.cs:94 C#
Void Firebase.Analytics.FirebaseAnalytics:.cctor ()+0x0 at Z:\tmp\tmp.DDcU9mvLy7\firebase\analytics\client\unity\proxy\FirebaseAnalytics.cs:20 C#

Void DarkroomMain:b__30_0 (Task`1)+0x47 at

@chkuang-g
Copy link
Contributor

chkuang-g commented Jan 31, 2020

Quick note:
Unity patched this issue in 2018.4.6f1 release.
https://unity3d.com/unity/whats-new/2018.4.6
"Android: Fixed Application.Quit not correctly quitting the application process, previously it would only destroy Unity runtime, keeping activity alive, that lead to incorrect application resume. (1171368, 1172044)"

That is, another option would be upgrade your Unity to any version after this.

@tzmm Your issue seems not related to what this thread was about, which is the crash in second launch if Application.Quit() is called before. If the problem still affects you, could you open a separate thread for more detail?

Thank you.
Shawn

@5D-ivyanshu
Copy link

Try this if the scripting backend "IL2CPP"

Firebase.FirebaseApp.DefaultInstance.Dispose();
Application.Quit();

I can confirm that the suggestion from @nextvern and @chkuang-g to Dispose() the FirebaseApp before OnApplicationQuit() does resolve the issue!
This was confirmed with Unity 2018.4.2f1 and 2019.2.1f1 and Firebase 6.1.1.

I wasted my whole night 18 hours straight to get to the root of this and I find this suggestion.. now I am going to test the build by disposing the instance.. I am make it clear if the issue persists or not .. so no one else has to go through what I have... Final reports coming ASAP

@chkuang-g
Copy link
Contributor

This seems to be fixed by Unity.

@5D-ivyanshu if you are still experience the same issue, please open a new bug and provide the details about your configuration.

I will close this issue for now.

@firebase firebase locked and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests