Failed to get document from server error while fetching from cache
Please fill in the following fields:
Unity editor version: 2019.2.11f1 Firebase Unity SDK version: 6.15.0 Source you installed the SDK (.unitypackage or Unity Package Manager): Unity Package Manager Firebase plugins in use (Auth, Database, etc.): Auth, Firestore, Analytic, Functions (installed, not using it) Additional SDKs you are using (Facebook, AdMob, etc.): Not yet Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows Platform you are targeting (iOS, Android, and/or desktop): Android Scripting Runtime (Mono, and/or IL2CPP): Mono
Please describe the issue here:
(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
Issue 1:
I am executing below line of code
snap = await document.GetSnapshotAsync(Source.Cache);
I am getting below error Failed to get document from server. (However, this document does exist in the local cache......)
Here I am trying to get document from local cache, but either it's trying to fetch it from server and getting failed or giving me incorrect error, also for your information, I have the document in cache.
Issue 2:
I have a stable internet connection, when I am executing below line of code
snap = await document.GetSnapshotAsync(Source.Server);
I am getting the same error: Failed to get document from server. (However, this document does exist in the local cache......)
But when I try to run the same code followed by EnableNetworkAsync() method like below
while (!success)
{
await Firestore.EnableNetworkAsync();
snap = await document.GetSnapshotAsync(Source.Server);
success = true;
}
It takes around 10 sec for the first time to execute inner code of above loop, and gets failed, after that it does not take any time to execute both of above async lines of code, and gets failed many times, and then sometimes it gets succeeded in editor, but still no luck in physical android device. I also looked into adb logs, which shows "Could not reach cloud firestore backend"
Logs from adb

Please answer the following, if applicable:
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? Not tried yet, as it ll take time to first install the compatible unity editor version to run the project.
What's the issue repro rate? (eg 100%, 1/5 etc) 100%
Hi @ashokdamani! Thank you for using the Unity Firestore SDK and letting us know about your problem. I'd like to investigate and some extra logs would be very helpful.
Could you enable debug logging by invoking FirebaseFirestore.LogLevel = LogLevel.Debug immediately after creating the FirebaseFirestore object? Make sure to enable debug logging after creating the FirebaseFirestore object (and not before) to work around a potential bug where setting the log level to Debug doesn't always take effect (https://groups.google.com/g/firebase-talk/c/GJQH_0rvmHM/m/h-cLYnbWAQAJ).
Then, reproduce the issue and attach the resulting logs to this ticket. I'll take a look at the logs and let you know if anything looks suspicious. If you're willing to publish a small app that reproduces the issue, that could be very helpful too.
Hi @dconeybe Thanks for responding!
I have changed the log level in my data service class, where I am getting the default FirebaseFirestore instance like below:
public FBService()
{
Auth = FirebaseAuth.DefaultInstance;
Firestore = FirebaseFirestore.GetInstance(FirebaseApp.DefaultInstance);
FirebaseFirestore.LogLevel = LogLevel.Debug;
Firestore.Settings.WithPersistenceEnabled(true);
}
This is the code, where I am getting error:
snap = await document.GetSnapshotAsync(Source.Server);
The logs are as shown below: (To find full log file, please see at https://justpaste.it/5d0fz), Just search for text Could not reach Cloud Firestore backend. in below logs or log file attached in above url.
08-20 12:35:22.929: I/Firestore(2043): (21.4.3) [ga]: (8c5dd46) Stream is open
08-20 12:35:22.941: I/Firestore(2043): (21.4.3) [ga]: (8c5dd46) Stream sending: # com.google.firestore.v1.Aa@1cdd88e1
08-20 12:35:22.949: I/Firestore(2043): (21.4.3) [GrpcCallProvider]: Current gRPC connectivity state: CONNECTING
08-20 12:35:22.949: I/Firestore(2043): (21.4.3) [GrpcCallProvider]: Setting the connectivityAttemptTimer
08-20 12:35:23.102: I/Firestore(2043): (21.4.3) [IndexFreeQueryEngine]: Using full collection scan to execute query: Query(target=Query(Common/GameSync order by __name__);limitType=LIMIT_TO_FIRST)
08-20 12:35:23.109: I/Firestore(2043): (21.4.3) [fa]: (485804d) Stream is open
08-20 12:35:23.110: I/Firestore(2043): (21.4.3) [fa]: (485804d) Stream sending: # com.google.firestore.v1.S@cffd63fb
08-20 12:35:23.217: I/AuthChimeraService(2911): Executing send connection operation [CONTEXT service_id=16 ]
08-20 12:35:23.236: D/FirebaseAuth(2043): Notifying id token listeners about user ( T3om7EVUwXYgNsXl0zgaOeGggf93 ).
08-20 12:35:23.239: I/Firestore(2043): (21.4.3) [FirestoreClient]: Credential changed. Current user: T3om7EVUwXYgNsXl0zgaOeGggf93
08-20 12:35:23.242: I/Firestore(2043): (21.4.3) [RemoteStore]: Restarting streams for new credential.
08-20 12:35:23.243: I/Firestore(2043): (21.4.3) [fa]: (485804d) Performing stream teardown
08-20 12:35:23.244: I/Firestore(2043): (21.4.3) [fa]: (485804d) Closing stream client-side
08-20 12:35:23.245: I/Firestore(2043): (21.4.3) [ga]: (8c5dd46) Performing stream teardown
08-20 12:35:23.246: I/Firestore(2043): (21.4.3) [ga]: (8c5dd46) Closing stream client-side
08-20 12:35:23.247: I/Firestore(2043): (21.4.3) [RemoteStore]: Stopping write stream with 10 pending writes
08-20 12:35:23.284: I/Firestore(2043): (21.4.3) [fa]: (485804d) Stream is open
08-20 12:35:23.285: I/Firestore(2043): (21.4.3) [fa]: (485804d) Stream sending: # com.google.firestore.v1.S@cffd63fb
08-20 12:35:23.287: I/Firestore(2043): (21.4.3) [ga]: (8c5dd46) Stream is open
08-20 12:35:23.288: I/Firestore(2043): (21.4.3) [ga]: (8c5dd46) Stream sending: # com.google.firestore.v1.Aa@1cdd88e1
08-20 12:35:25.349: D/NtpTrustedTime(1634): currentTimeMillis() cache hit
08-20 12:35:25.376: D/NtpTrustedTime(1634): currentTimeMillis() cache hit
08-20 12:35:25.380: I/TrafficManageService(4964): mina mTrafficStatsReceiver onReceive
08-20 12:35:25.846: D/CompatibilityInfo(1634): mCompatibilityFlags - 0
08-20 12:35:25.846: D/CompatibilityInfo(1634): applicationDensity - 440
08-20 12:35:25.846: D/CompatibilityInfo(1634): applicationScale - 1.0
08-20 12:35:25.857: D/CompatibilityInfo(1634): mCompatibilityFlags - 0
08-20 12:35:25.857: D/CompatibilityInfo(1634): applicationDensity - 440
08-20 12:35:25.857: D/CompatibilityInfo(1634): applicationScale - 1.0
08-20 12:35:25.946: D/DcNetworkAgent(2282): NetworkAgent: Changed from [ Transports: CELLULAR Capabilities: SUPL&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&NOT_ROAMING&NOT_CONGESTED Unwanted: LinkUpBandwidth>=32Kbps Specifier: <2>] to [ Transports: CELLULAR Capabilities: SUPL&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&NOT_ROAMING&NOT_CONGESTED Unwanted: LinkUpBandwidth>=134Kbps Specifier: <2>], Data RAT=14, mApnSetting=[ApnSettingV5] Mobile Office, 2260, 40449, airtelgprs.com, , , , , , -1, default | supl, IPV4V6, IPV4V6, true, 0, 0, 0, false, 0, 0, 0, 0, , , false, 0, 0
08-20 12:35:25.948: D/DcNetworkAgent(2282): NetworkAgent: Changed from [ Transports: CELLULAR Capabilities: IMS&NOT_METERED&TRUSTED&NOT_VPN&NOT_ROAMING&NOT_CONGESTED Unwanted: LinkUpBandwidth>=32Kbps Specifier: <2>] to [ Transports: CELLULAR Capabilities: IMS&NOT_METERED&TRUSTED&NOT_VPN&NOT_ROAMING&NOT_CONGESTED Unwanted: LinkUpBandwidth>=134Kbps Specifier: <2>], Data RAT=14, mApnSetting=[ApnSettingV5] IMS, 2261, 40449, ims, , , , , , -1, ims, IPV4V6, IPV4V6, true, 0, 0, 0, false, 0, 0, 0, 0, , , false, 0, 0
08-20 12:35:25.957: D/NtpTrustedTime(1634): currentTimeMillis() cache hit
08-20 12:35:27.748: I/ActivityManager(1634): Killing 30484:com.miui.android.fashiongallery/u0a162 (adj 906): empty #17
08-20 12:35:25.957: D/NtpTrustedTime(1634): currentTimeMillis() cache hit
08-20 12:35:27.752: W/libprocessgroup(1634): kill(-30484, 9) failed: No such process
08-20 12:35:27.809: D/ConnectivityService(1634): ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=360, [ Transports: WIFI Capabilities: NOT_RESTRICTED&TRUSTED&NOT_VPN&FOREGROUND Unwanted: Uid: 10162] ], android.os.BinderProxy@374b380)
08-20 12:35:27.802: I/chatty(1634): uid=1000(system) ActivityManager identical 9 lines
08-20 12:35:27.808: W/libprocessgroup(1634): kill(-30484, 9) failed: No such process
08-20 12:35:27.811: I/Zygote(586): Process 30484 exited due to signal (9)
08-20 12:35:27.813: W/libprocessgroup(1634): kill(-30484, 9) failed: No such process
08-20 12:35:27.813: I/libprocessgroup(1634): Successfully killed process cgroup uid 10162 pid 30484 in 62ms
08-20 12:35:28.551: D/NetworkController.MobileSignalController(2)(1883): getDataNetTypeFromServiceState slotId=0 isUsingCarrierAggregation=false
08-20 12:35:28.551: D/NetworkTypeUtils(1883): getDataNetTypeFromServiceState:srcDataNetType = 13, destDataNetType 13
08-20 12:35:28.557: D/MobileSignalController(1883): updateDataType mSelectedDataTypeIcon[0]=2131232237, mSelectedDataActivityIndex=6
08-20 12:35:28.558: D/TelephonyIcons(1883): getSignalStrengthIcon: slot=0, inetCondition=1, level=2, roaming=false, signalstrength=SignalStrength: 99 0 -120 -160 -120 -160 -1 16 -113 -12 32 2147483647 0 2147483647 99 255 2147483647 gsm|lte use_rsrp_and_rssnr_for_lte_level [-128, -115, -110, -105, -97] [-115, -105, -95, -85]
08-20 12:35:28.558: D/TelephonyIcons(1883): getDataActivity, slot=0, activity=2
08-20 12:35:28.566: D/TelephonyIcons(1883): null signal icon name: drawable/stat_sys_signal_null
08-20 12:35:28.567: D/TelephonyIcons(1883): getDataTypeIcon sub=0
08-20 12:35:29.286: D/HBMFeatureControl(1634): brightness=366
08-20 12:35:29.289: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:29.303: D/HBMFeatureControl(1634): brightness=284
08-20 12:35:29.307: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:29.320: D/HBMFeatureControl(1634): brightness=201
08-20 12:35:29.322: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:29.335: D/HBMFeatureControl(1634): brightness=119
08-20 12:35:29.337: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:29.352: D/HBMFeatureControl(1634): brightness=37
08-20 12:35:29.354: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:29.369: D/HBMFeatureControl(1634): brightness=16
08-20 12:35:29.370: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:29.562: D/NetworkController.MobileSignalController(2)(1883): getDataNetTypeFromServiceState slotId=0 isUsingCarrierAggregation=false
08-20 12:35:29.562: D/NetworkTypeUtils(1883): getDataNetTypeFromServiceState:srcDataNetType = 13, destDataNetType 13
08-20 12:35:29.565: D/MobileSignalController(1883): updateDataType mSelectedDataTypeIcon[0]=2131232237, mSelectedDataActivityIndex=6
08-20 12:35:29.566: D/TelephonyIcons(1883): getSignalStrengthIcon: slot=0, inetCondition=1, level=2, roaming=false, signalstrength=SignalStrength: 99 0 -120 -160 -120 -160 -1 16 -113 -12 32 2147483647 0 2147483647 99 255 2147483647 gsm|lte use_rsrp_and_rssnr_for_lte_level [-128, -115, -110, -105, -97] [-115, -105, -95, -85]
08-20 12:35:29.566: D/TelephonyIcons(1883): getDataActivity, slot=0, activity=3
08-20 12:35:29.581: D/TelephonyIcons(1883): null signal icon name: drawable/stat_sys_signal_null
08-20 12:35:29.582: D/TelephonyIcons(1883): getDataTypeIcon sub=0
08-20 12:35:30.883: D/CompatibilityInfo(1634): mCompatibilityFlags - 0
08-20 12:35:30.883: D/CompatibilityInfo(1634): applicationDensity - 440
08-20 12:35:30.883: D/CompatibilityInfo(1634): applicationScale - 1.0
08-20 12:35:30.898: D/CompatibilityInfo(1634): mCompatibilityFlags - 0
08-20 12:35:30.899: D/CompatibilityInfo(1634): applicationDensity - 440
08-20 12:35:30.899: D/CompatibilityInfo(1634): applicationScale - 1.0
08-20 12:35:31.003: W/MiuiGesturePointerEventListener(1634): onActionDown end: mGestureStatus = 0
08-20 12:35:31.019: E/ANDR-PERF-MPCTL(676): Invalid profile no. 0, total profiles 0 only
08-20 12:35:31.021: D/HBMFeatureControl(1634): brightness=92
08-20 12:35:31.023: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:31.036: D/HBMFeatureControl(1634): brightness=174
08-20 12:35:31.037: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:31.052: D/HBMFeatureControl(1634): brightness=256
08-20 12:35:31.054: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:31.069: D/HBMFeatureControl(1634): brightness=339
08-20 12:35:31.071: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:31.086: D/HBMFeatureControl(1634): brightness=421
08-20 12:35:31.088: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:31.103: D/HBMFeatureControl(1634): brightness=441
08-20 12:35:31.105: D/HBMFeatureControl(1634): setBrightness,mNTCTemp36
08-20 12:35:32.256: W/PushService(5097): [Tid:288] [Job] check the ping-pong.1597907122255
08-20 12:35:32.257: W/PushService(6031): [Tid:357] [Job] check the ping-pong.1597907122255
08-20 12:35:32.259: W/PushService(5097): [Tid:288] disconnect 92923169, 183968661
08-20 12:35:32.264: W/PushService(5097): [Tid:288] update the connection status. connected -> disconnected : ERROR_PING_TIMEOUT
08-20 12:35:32.266: W/PushService(6031): [Tid:357] disconnect 213415890, 139984558
08-20 12:35:32.270: W/PushService(5097): [Tid:337] [Slim] read Blob [] Err:Socket closed
08-20 12:35:32.273: W/PushService(6031): [Tid:357] update the connection status. connected -> disconnected : ERROR_PING_TIMEOUT
08-20 12:35:32.277: W/PushService(6031): [Tid:397] [Slim] read Blob [] Err:Socket closed
08-20 12:35:32.282: W/PushService(6031): [Tid:357] schedule reconnect in 0ms
08-20 12:35:32.282: W/PushService(6031): [Tid:357] update the client 5 status. binded->unbind CLOSE ERROR_PING_TIMEOUT null null
08-20 12:35:32.283: W/PushService(6031): [Tid:357] [Job] do reconnect..
08-20 12:35:32.285: W/PushService(5097): [Tid:288] schedule reconnect in 0ms
08-20 12:35:32.285: W/PushService(6031): [Tid:357] update the connection status. disconnected -> connecting : ERROR_OK
08-20 12:35:32.285: W/PushService(5097): [Tid:288] update the client 5 status. binded->unbind CLOSE ERROR_PING_TIMEOUT null null
08-20 12:35:32.285: W/PushService(5097): [Tid:288] [Job] do reconnect..
08-20 12:35:32.288: W/PushService(5097): [Tid:288] update the connection status. disconnected -> connecting : ERROR_OK
08-20 12:35:32.291: W/PushService(6031): [Tid:357] begin to connect to idmb-app-chat-global-xiaomi03new-426797692.ap-south-1.elb.amazonaws.com:5222
08-20 12:35:32.295: W/PushService(5097): [Tid:288] begin to connect to idmb-app-chat-global-xiaomi06-2047145834.ap-south-1.elb.amazonaws.com:5222
08-20 12:35:32.307: I/DpmTcmClient(6031): RegisterTcmMonitor from: $Proxy0
08-20 12:35:32.310: W/PushService(5097): [Tid:338] No ready file to get data from mipush_country_code
08-20 12:35:32.314: I/DpmTcmClient(5097): RegisterTcmMonitor from: $Proxy0
08-20 12:35:32.585: W/PushService(6031): [Tid:357] tcp connected
08-20 12:35:32.588: W/PushService(5097): [Tid:288] tcp connected
08-20 12:35:32.591: W/PushService(6031): [Tid:357] [slim] open conn: andver=28 sdk=41 hash=a-134560264993012B647C34FF3541DFB5726311DE tz=5:0 Model=Redmi Note 7 Pro os=V11.0.9.0.PFHINXM
08-20 12:35:32.591: W/PushService(6031): [Tid:357] connected to idmb-app-chat-global-xiaomi03new-426797692.ap-south-1.elb.amazonaws.com:5222 in 300
08-20 12:35:32.597: W/PushService(5097): [Tid:288] [slim] open conn: andver=28 sdk=41 hash=a-6109AB77B120DA7E23456886A692B875657236D6 tz=5:0 Model=Redmi Note 7 Pro os=V11.0.9.0.PFHINXM
08-20 12:35:32.598: W/PushService(5097): [Tid:288] connected to idmb-app-chat-global-xiaomi06-2047145834.ap-south-1.elb.amazonaws.com:5222 in 302
08-20 12:35:32.610: D/NtpTrustedTime(1634): currentTimeMillis() cache hit
08-20 12:35:32.613: W/PushService(6031): [Tid:357] [Job] notify job
08-20 12:35:32.622: W/PushService(5097): [Tid:288] [Job] notify job
08-20 12:35:32.665: W/PushService(6031): [Tid:400] setChallenge hash = 56d84a09
08-20 12:35:32.665: W/PushService(5097): [Tid:340] setChallenge hash = 05ad98bf
08-20 12:35:32.666: W/PushService(6031): [Tid:400] update the connection status. connecting -> connected : ERROR_OK
08-20 12:35:32.666: W/PushService(5097): [Tid:340] update the connection status. connecting -> connected : ERROR_OK
08-20 12:35:32.677: E/TelephonyEventHandler(4598): Received network connection action
08-20 12:35:32.678: W/PushService(5097): [Tid:340] [Slim] CONN: host = 84e5
08-20 12:35:32.678: W/PushService(5097): [Tid:288] [Job] bind the client. 5
08-20 12:35:32.678: D/NtpTrustedTime(1634): currentTimeMillis() cache hit
08-20 12:35:32.678: W/PushService(6031): [Tid:400] [Slim] CONN: host = d985
08-20 12:35:32.679: W/PushService(5097): [Tid:288] update the client 5 status. unbind->binding unknown ERROR_OK null null
08-20 12:35:32.679: E/TelephonyEventHandler(4598): Received network connection action currentNwType=0
08-20 12:35:32.679: W/PushService(5097): [Tid:288] [Slim]: bind id=G46qX-362
08-20 12:35:32.679: W/PushService(6031): [Tid:357] [Job] bind the client. 5
08-20 12:35:32.679: W/PushService(6031): [Tid:357] update the client 5 status. unbind->binding unknown ERROR_OK null null
08-20 12:35:32.679: W/PushService(6031): [Tid:357] [Slim]: bind id=rr01A-368
08-20 12:35:32.680: I/TrafficManageService(4964): mina mTrafficStatsReceiver onReceive
08-20 12:35:32.688: D/CompatibilityInfo(1634): mCompatibilityFlags - 0
08-20 12:35:32.688: D/CompatibilityInfo(1634): applicationDensity - 440
08-20 12:35:32.688: D/CompatibilityInfo(1634): applicationScale - 1.0
08-20 12:35:32.705: D/IdProviderImpl(5097): getOAID
08-20 12:35:32.710: D/IdProviderImpl(5097): getVAID
08-20 12:35:32.716: D/IdProviderImpl(5097): getAAID
08-20 12:35:32.746: W/PushService(6031): [Tid:357] SMACK: channel bind succeeded, chid=5
08-20 12:35:32.746: W/PushService(6031): [Tid:357] update the client 5 status. binding->binded OPEN ERROR_OK null null
08-20 12:35:32.746: W/PushService(5097): [Tid:288] SMACK: channel bind succeeded, chid=5
08-20 12:35:32.747: W/PushService(5097): [Tid:288] update the client 5 status. binding->binded OPEN ERROR_OK null null
08-20 12:35:32.749: W/PushService(5097): [Tid:288] [Job] notify job
08-20 12:35:32.749: W/PushService(6031): [Tid:357] [Job] notify job
08-20 12:35:33.259: W/Firestore(2043): (21.4.3) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
08-20 12:35:33.259: W/Firestore(2043): This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
08-20 12:35:33.264: I/Firestore(2043): (21.4.3) [L]: Starting transaction: Release target
08-20 12:35:33.273: I/Firestore(2043): (21.4.3) [fa]: (485804d) Stream sending: # com.google.firestore.v1.S@7accd78f
08-20 12:35:33.352: E/Unity(2043): adlabs_logs: Error while reading data: Common/GameSync, offline: False, error: Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to SERVER to retrieve the cached document.)
08-20 12:35:33.352: E/Unity(2043): UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
08-20 12:35:33.352: E/Unity(2043): UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
08-20 12:35:33.352: E/Unity(2043): UnityEngine.Logger:Log(LogType, Object)
08-20 12:35:33.352: E/Unity(2043): UnityEngine.Debug:LogError(Object)
Thanks, Ashok
Hi @ashokdamani. I looked at the logs that you posted (thanks!) but nothing looked suspicious. So I attempted to reproduce but did not have success: the calls to DocumentReference.GetSnapshotAsync() all succeeded, both when Source.Server and Source.Cache were specified.
Below are the steps that I followed to reproduce. Could you give them a try and let me know what you experience?
- In the "Cloud Firestore" page of the Firebase Console, create a document named
UnityIssue756/UnityIssue756Docwith a key/value pair with key=name and value=UnityIssue756Value. - Create a brand new Unity Project via the Unity Hub or Unity Editor.
- Add the Firestore Unity SDKs to this new Unity project, as documented at https://firebase.google.com/download/unity#add-sdks
- Under "Project" -> "Assets", right click and select "Create" -> "C# Script"; name the script
UnityIssue756. - Edit the newly-created C# script in a text editor and paste the C# code below, replacing the
AppId,ApiKey, andProjectIdwith the values corresponding to your Firebase project; see https://firebase.google.com/docs/reference/unity/class/firebase/app-options if you are unsure where to get these values. - Add a new "empty" to the
SampleScene - In the "Inspector" for the new empty (which, for me, was simply named "GameObject") click "Add Component" -> "Scripts" -> "UnityIssue756".
- Press the "Play" button to run the app.
If the app completes successfully, you should see the following line logged:
UnityIssue756Log name=UnityIssue756Value
Finally, try exporting the project to Android in the problematic environment. See if the app succeeds or fails in reading the document. Try using different Source values.
Here are the contents of UnityIssue756.cs referenced in the steps above:
using Firebase;
using Firebase.Firestore;
using UnityEngine;
public class UnityIssue756 : MonoBehaviour {
void Start() {
Debug.Log("UnityIssue756Log Start() starting");
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith((task) => {
if (task.Result != Firebase.DependencyStatus.Available) {
Debug.LogError("UnityIssue756Log ERROR: CheckAndFixDependenciesAsync() failed: " + task.Result);
} else {
OnDependenciesCheckedAndFixed();
}
});
}
private async void OnDependenciesCheckedAndFixed() {
AppOptions appOptions = new AppOptions();
appOptions.AppId = "REPLACE_WITH_YOUR_APP_ID";
appOptions.ApiKey = "REPLACE_WITH_YOUR_API_KEY";
appOptions.ProjectId = "REPLACE_WITH_YOUR_PROJECT_ID";
FirebaseApp firebaseApp = FirebaseApp.Create(appOptions, "unity-issue-756");
FirebaseFirestore firestore = FirebaseFirestore.GetInstance(firebaseApp);
DocumentReference doc = firestore.Document("UnityIssue756/UnityIssue756Doc");
Debug.Log("UnityIssue756Log GetSnapshotAsync() starting");
DocumentSnapshot snapshot = await doc.GetSnapshotAsync(Source.Server);
string value;
snapshot.TryGetValue("name", out value, ServerTimestampBehavior.None);
Debug.Log("UnityIssue756Log name=" + value);
}
}
Hi @dconeybe Thanks for looking into it.
The issue is very less likable to get reproduced. For me, following are the observations till now for this issue:
- It never works on my Xiaomi redmi note 7 pro using Airtel network (it used work few days back when, but now stopped)
- It never works on my Xiaomi redmi note 7 using Airtel network
- It always work on my Xiaomi redmi note 7 using Idea network
- It sometimes works in my unity editor, when I call my getSnapshot method in a loop using Airtel hotspot network
- It always works in my unity editor using Idea hotspot network
- It always works on my Samsung phone using Airtel and Idea network
- It always works on one of my friend's phone, he uses a broadband WIFI connection
However I will try to get the sample app build and tested to share with you, but most probably it won't reproduce the issue at your place, because the issue seems to be related to specific network and phone.
Hi @ashokdamani. We are not aware of any issues specified to the Xiaomi Redmi Note 7 or the Airtel network. So I will definitely need your help to investigate.
Could you try building the sample app I outlined in a previous comment (UnityIssue756.cs) and let me know what happens, including logs?
Could you also try using the "normal" Android SDK to write a minimal app to reproduce? The Firestore Unity SDK uses the Android SDK under the hood so it would be good to know if the issue exists with the raw Android SDK.
Hey @ashokdamani. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Hi @dconeybe I am working on sample app, meanwhile can you please check below logs, I am getting these while getting data through listener as get snapshot isn't working.
java.lang.Error: FATAL EXCEPTION [UnityMain]
Unity version : 2019.2.11f1
Device model : Xiaomi Redmi Note 7 Pro
Device fingerprint: xiaomi/violet/violet:9/PKQ1.181203.001/V11.0.9.0.PFHINXM:user/release-keys
Caused by: java.lang.Error: signal 6 (SIGABRT), code -6 (?), fault addr --------
Build fingerprint: 'xiaomi/violet/violet:9/PKQ1.181203.001/V11.0.9.0.PFHINXM:user/release-keys'
Revision: '0'
pid: 26729, tid: 26764, name: UnityMain >>> com.DefaultCompany.TheCarGame <<<
x0 0000000000000000 x1 000000000000688c x2 0000000000000006 x3 0000000000000008
x4 fefeff72820e7667 x5 fefeff72820e7667 x6 fefeff72820e7667 x7 7f7f7f7fff7f7f7f
x8 0000000000000083 x9 972b50f633b97dc2 x10 0000000000000000 x11 fffffffc7ffffbdf
x12 0000000000000001 x13 000000000000000c x14 ffffffffff000000 x15 ffffffffffffffff
x16 00000073813292b8 x17 0000007381248c50 x18 0000000000000010 x19 0000000000006869
x20 000000000000688c x21 00000072d1281d80 x22 0000000000000000 x23 00000072fead3a53
x24 00000072fead3907 x25 0000000000000001 x26 00000072e33f5b10 x27 0000000000000043
x28 00000072ff313720 x29 00000072e33f59c0 x30 000000738123c0c4
sp 00000072e33f5980 pc 000000738123c0ec pstate 0000000060000000
at [vdso].(:0)
at libc.abort(abort:112)
at libart._ZN3art7Runtime5AbortEPKc(_ZN3art7Runtime5AbortEPKc:1196)
at libbase._ZN7android4base10LogMessageD1Ev(_ZN7android4base10LogMessageD1Ev:724)
at libart._ZN3art9JavaVMExt8JniAbortEPKcS2_(_ZN3art9JavaVMExt8JniAbortEPKcS2_:1640)
at libart._ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list(_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list:116)
at libart._ZN3art12_GLOBAL__N_111ScopedCheck6AbortFEPKcz(_ZN3art12_GLOBAL__N_111ScopedCheck6AbortFEPKcz:148)
at libart._ZN3art12_GLOBAL__N_111ScopedCheck17CheckMethodAndSigERNS_18ScopedObjectAccessEP8_jobjectP7_jclassP10_jmethodIDNS_9Primitive4TypeENS_10InvokeTypeE(_ZN3art12_GLOBAL__N_111ScopedCheck17CheckMethodAndSigERNS_18ScopedObjectAccessEP8_jobjectP7_jclassP10_jmethodIDNS_9Primitive4TypeENS_10InvokeTypeE:1592)
at libart._ZN3art12_GLOBAL__N_18CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE(_ZN3art12_GLOBAL__N_18CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE:760)
at libart._ZN3art12_GLOBAL__N_18CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list(_ZN3art12_GLOBAL__N_18CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list:92)
at libFirebaseCppApp-6_15_0._ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz(_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz:92)
at libFirebaseCppApp-6_15_0._ZNK8firebase9firestore18FieldValueInternal9map_valueEv(_ZNK8firebase9firestore18FieldValueInternal9map_valueEv:160)
at libFirebaseCppApp-6_15_0._ZNK8firebase9firestore24DocumentSnapshotInternal7GetDataENS0_16DocumentSnapshot23ServerTimestampBehaviorE(_ZNK8firebase9firestore24DocumentSnapshotInternal7GetDataENS0_16DocumentSnapshot23ServerTimestampBehaviorE:132)
at libFirebaseCppApp-6_15_0.Firebase_Firestore_CSharp_DocumentSnapshotInternal_GetData__SWIG_0(Firebase_Firestore_CSharp_DocumentSnapshotInternal_GetData__SWIG_0:32)
at libil2cpp.FirestoreUtilPINVOKE_DocumentSnapshotInternal_GetData__SWIG_0_m5F96A7FB36CD788A72CA1ECA40E09F2A38E1179B(FirestoreUtilPINVOKE_DocumentSnapshotInternal_GetData__SWIG_0_m5F96A7FB36CD788A72CA1ECA40E09F2A38E1179B:192)
at libil2cpp.DocumentSnapshotInternal_GetData_m649D9EDAFBD71B4605E8C3EFE59B6F477CEA2F5C(DocumentSnapshotInternal_GetData_m649D9EDAFBD71B4605E8C3EFE59B6F477CEA2F5C:484)
at libil2cpp._ZN16VirtFuncInvoker1IP66SWIGTYPE_p_MapFieldValue_t2F540E4EB3E326712D605D38BF65637E8D8D9D86iE6InvokeEjP12Il2CppObjecti(_ZN16VirtFuncInvoker1IP66SWIGTYPE_p_MapFieldValue_t2F540E4EB3E326712D605D38BF65637E8D8D9D86iE6InvokeEjP12Il2CppObjecti:172)
at libil2cpp.DocumentSnapshot_ConvertTo_TisRuntimeObject_m3A46FA6D78D8D8D38F759F5C05FB0D911274A436_gshared(DocumentSnapshot_ConvertTo_TisRuntimeObject_m3A46FA6D78D8D8D38F759F5C05FB0D911274A436_gshared:604)
at libil2cpp._Z126DocumentSnapshot_ConvertTo_TisDictionary_2_t9140A71329927AE4FD0F3CF4D4D66668EBE151EA_m32C9D0C414530AA2E574B16820CE718FCE82A3A7P58DocumentSnapshot_t58DEF9A26C1C4A1075B5CB4B252CA949A0500B6DiPK10MethodInfo(_Z126DocumentSnapshot_ConvertTo_TisDictionary_2_t9140A71329927AE4FD0F3CF4D4D66668EBE151EA_m32C9D0C414530AA2E574B16820CE718FCE82A3A7P58DocumentSnapshot_t58DEF9A26C1C4A1075B5CB4B252CA949A0500B6DiPK10MethodInfo:36)
at libil2cpp.DocumentSnapshot_ToDictionary_m1B5255BB85D6CF78A9EBDA0C7555194EFC69C13A(DocumentSnapshot_ToDictionary_m1B5255BB85D6CF78A9EBDA0C7555194EFC69C13A:104)
at libil2cpp.U3CU3Ec__DisplayClass65_0_1_U3CGetByListnerFallbackU3Eb__0_m0A75E60344993FD5F2516B2E3CD80C3FCB0F1684_gshared(U3CU3Ec__DisplayClass65_0_1_U3CGetByListnerFallbackU3Eb__0_m0A75E60344993FD5F2516B2E3CD80C3FCB0F1684_gshared:700)
at libil2cpp.Action_1_Invoke_mB86FC1B303E77C41ED0E94FC3592A9CF8DA571D5_gshared(Action_1_Invoke_mB86FC1B303E77C41ED0E94FC3592A9CF8DA571D5_gshared:780)
at libil2cpp._Z57Action_1_Invoke_mD882D6EAB1793FC1E61D095F2EF05F67DD0AAA84P50Action_1_t9A39EEF1AFCEDD36BBAB361F3070CBC1F9AE056BP58DocumentSnapshot_t58DEF9A26C1C4A1075B5CB4B252CA949A0500B6DPK10MethodInfo(_Z57Action_1_Invoke_mD882D6EAB1793FC1E61D095F2EF05F67DD0AAA84P50Action_1_t9A39EEF1AFCEDD36BBAB361F3070CBC1F9AE056BP58DocumentSnapshot_t58DEF9A26C1C4A1075B5CB4B252CA949A0500B6DPK10MethodInfo:36)
at libil2cpp.U3CListenU3Ec__AnonStorey0_U3CU3Em__0_m8380C25168EA22A54C3B09153C46ED2D4611E1DA(U3CListenU3Ec__AnonStorey0_U3CU3Em__0_m8380C25168EA22A54C3B09153C46ED2D4611E1DA:672)
at libil2cpp.Action_1_Invoke_mB86FC1B303E77C41ED0E94FC3592A9CF8DA571D5_gshared(Action_1_Invoke_mB86FC1B303E77C41ED0E94FC3592A9CF8DA571D5_gshared:780)
at libil2cpp._Z57Action_1_Invoke_mE7B6B757819009DD29ABD010657959BD7925B922P50Action_1_t84EFD6CE0FDFFC978B9BA133AA6D91CC4BDB8692P66DocumentSnapshotInternal_tA8C0EB3935A1D759A015787E84D4C6898FA47A31PK10MethodInfo(_Z57Action_1_Invoke_mE7B6B757819009DD29ABD010657959BD7925B922P50Action_1_t84EFD6CE0FDFFC978B9BA133AA6D91CC4BDB8692P66DocumentSnapshotInternal_tA8C0EB3935A1D759A015787E84D4C6898FA47A31PK10MethodInfo:36)
at libil2cpp.U3CListenerHandlerU3Ec__AnonStorey1_U3CU3Em__0_m950328224D66AEE8A5228D48C77843EB497A4C9E(U3CListenerHandlerU3Ec__AnonStorey1_U3CU3Em__0_m950328224D66AEE8A5228D48C77843EB497A4C9E:1408)
at libil2cpp.Action_Invoke_mC8D676E5DDF967EC5D23DD0E96FB52AA499817FD(Action_Invoke_mC8D676E5DDF967EC5D23DD0E96FB52AA499817FD:488)
at libil2cpp.ExceptionAggregator_Wrap_m93A9BD0DC888F1D02E77860288095CB49D4CFFC2(ExceptionAggregator_Wrap_m93A9BD0DC888F1D02E77860288095CB49D4CFFC2:368)
at libil2cpp.DocumentReference_ListenerHandler_mCF85FBCD3B6DBFB425823417BD5E2B8BBF49AE46(DocumentReference_ListenerHandler_mCF85FBCD3B6DBFB425823417BD5E2B8BBF49AE46:724)
at libil2cpp.ReversePInvokeWrapper_DocumentReference_ListenerHandler_mCF85FBCD3B6DBFB425823417BD5E2B8BBF49AE46(ReversePInvokeWrapper_DocumentReference_ListenerHandler_mCF85FBCD3B6DBFB425823417BD5E2B8BBF49AE46:44)
at libFirebaseCppApp-6_15_0._ZN8firebase9firestore6csharp21DocumentEventListener21DocumentSnapshotEventEiNS0_16DocumentSnapshotENS0_5ErrorE(_ZN8firebase9firestore6csharp21DocumentEventListener21DocumentSnapshotEventEiNS0_16DocumentSnapshotENS0_5ErrorE:84)
Hi @ashokdamani. That stack trace looks interesting. I'll look more closely and respond today or tomorrow. Please try out the sample code I provided (it should only take 10-20 minutes). I'm quite interested to know if it reproduces the issue that you are experiencing.
Also, in the first comment on this issue you stated
Scripting Runtime (Mono, and/or IL2CPP): Mono
However, the stack trace in the previous comment indicates that you are using il2cpp. Could you confirm which scripting runtime you are using?
Hi, Earlier I was using Mono, but today I just tried out changing the scripting runtime to il2cpp, if this fixes the issue, but it didn't. I am changing my runtime again back to Mono. Also as you mentioned the sample code should take around 20 mins, I didn't get that point, because as per knowledge creating a new unity project, adding firebase Auth and firestore packages, setting up keystore, exporting apk etc will take a considerable amount of efforts and time, and that too won't ensure that it ll reproduce the issue, as it's not happening in all the devices and networks as I tested my app. But anyway I ll try if I can build this sample app this weekend and share it with you. Thanks
Okay that makes sense about il2cpp. I can't tell for sure if the stack trace is related or not to your original issue. It's possibly a symptom of the same problem but I'm not sure yet. I will try to figure it out though.
The reason I'm asking you to try out the sample code that I provided is that it will make it much easier to investigate on my end. I'm not able to reproduce the issue you are experiencing so I'm debugging blindly and just guessing at problems and solutions right now. Knowing if you can or cannot reproduce the issue with the minimal app I provided would be key information to help investigate. If you don't have the time to try out the sample app that is totally ok. I'll still do my best to try and get to the root cause and solution.
This is related to same issue only, because it is exiting the app while executing same lines of code, just FYI, earlier I was getting the data through getSnapshotAsync which was failing so I replaced that code with Listener, for which I shared the logs above, which is also failing. I ll build the app and share with you this Saturday mostly. Thanks
I also just noticed that in the first comment you mentioned
Firebase Unity SDK version: 6.15.0
Could you try upgrading to the latest version, 6.15.2? There were many fixes between those two versions that may fix your issue.
Hi @dconeybe I have upgraded the Firebase packages to 6.15.2 as you asked, But now I am getting a new error while exporting/building an apk, please help me resolve this, its a blocker for me, I did run Force Resolve in external dependency manager after upgrading all firebase packages.
More than one file was found with OS independent path 'lib/armeabi-v7a/libFirebaseCppFunctions.so'
The logs:
CommandInvokationFailure: Gradle build failed.
C:/Program Files/Unity/Hub/Editor/2019.2.11f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformNativeLibsWithMergeJniLibsForDebug'.
> More than one file was found with OS independent path 'lib/armeabi-v7a/libFirebaseCppFunctions.so'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2m 38s
]
stdout[
> Configure project :
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\extras\google\usb_driver\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-28\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\extras\google\usb_driver\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-28\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
> Task :preBuild UP-TO-DATE
> Task :extractProguardFiles
> Task :Firebase:preBuild UP-TO-DATE
> Task :Firebase:preDebugBuild UP-TO-DATE
> Task :Firebase:checkDebugManifest
> Task :Firebase:processDebugManifest
> Task :preDebugBuild
> Task :Firebase:compileDebugAidl NO-SOURCE
> Task :compileDebugAidl NO-SOURCE
> Task :Firebase:packageDebugRenderscript NO-SOURCE
> Task :compileDebugRenderscript NO-SOURCE
> Task :checkDebugManifest
> Task :generateDebugBuildConfig
> Task :prepareLintJar
> Task :generateDebugSources
> Task :Firebase:compileDebugRenderscript NO-SOURCE
> Task :Firebase:generateDebugBuildConfig
> Task :Firebase:generateDebugResValues
> Task :Firebase:generateDebugResources
> Task :Firebase:packageDebugResources
> Task :Firebase:generateDebugRFile
> Task :Firebase:prepareLintJar
> Task :Firebase:generateDebugSources
> Task :Firebase:javaPreCompileDebug
> Task :Firebase:compileDebugJavaWithJavac
> Task :Firebase:bundleLibCompileDebug
> Task :javaPreCompileDebug
> Task :mainApkListPersistenceDebug
> Task :generateDebugResValues
> Task :generateDebugResources
> Task :mergeDebugResources
> Task :createDebugCompatibleScreenManifests
> Task :processDebugManifest
G:\projects\git\unity\TheCarGame\WS4\TheCarGame\Temp\gradleOut\src\main\AndroidManifest.xml:24:9-31:50 Warning:
activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present
> Task :processDebugResources
> Task :compileDebugJavaWithJavac
> Task :compileDebugSources
> Task :mergeDebugShaders
> Task :compileDebugShaders
> Task :generateDebugAssets
> Task :Firebase:mergeDebugShaders
> Task :Firebase:compileDebugShaders
> Task :Firebase:generateDebugAssets
> Task :Firebase:packageDebugAssets
> Task :mergeDebugAssets
> Task :validateSigningDebug
> Task :signingConfigWriterDebug
> Task :processDebugJavaRes NO-SOURCE
> Task :Firebase:processDebugJavaRes NO-SOURCE
> Task :Firebase:bundleLibResDebug
> Task :transformResourcesWithMergeJavaResForDebug
> Task :Firebase:bundleLibRuntimeDebug
> Task :Firebase:mergeDebugConsumerProguardFiles
> Task :transformClassesAndResourcesWithR8ForDebug
R8 is the new Android code shrinker. If you experience any issues, please file a bug at
https://issuetracker.google.com, using 'Shrinker (R8)' as component name. You can
disable R8 by updating gradle.properties with 'android.enableR8=false'.
Current version is: 1.4.77 (build b74371231cb896b02f83285efb055b7c00ff64d8 from go/r8bot (luci-r8-ci-archive-0-eqqf)).
D8: The rule `-keep public class * extends androidx.versionedparcelable.VersionedParcelable {
<init>();
}` uses extends but actually matches implements.
G:\projects\git\unity\TheCarGame\WS4\TheCarGame\Temp\gradleOut\libs\com.squareup.okhttp3.okhttp-3.12.1.jar: D8: Type `org.conscrypt.Conscrypt` was not found, it is required for default or static interface methods desugaring of `void okhttp3.internal.platform.ConscryptPlatform.configureSslSocketFactory(javax.net.ssl.SSLSocketFactory)`
G:\projects\git\unity\TheCarGame\WS4\TheCarGame\Temp\gradleOut\libs\com.google.guava.guava-28.1-android.jar: D8: Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `void com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper.<clinit>()`
> Task :mergeDebugJniLibFolders
> Task :Firebase:mergeDebugJniLibFolders
> Task :Firebase:transformNativeLibsWithMergeJniLibsForDebug
> Task :Firebase:transformNativeLibsWithIntermediateJniLibsForDebug
> Task :transformNativeLibsWithMergeJniLibsForDebug FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
41 actionable tasks: 41 executed
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <2a151ab0aea840598e2f18fa24d85ada>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
UnityEditor.BuildPipeline:BuildPlayer(String[], String, BuildTarget, BuildOptions)
Autobuilder:Build(BuildOptions) (at Assets/scripts/models/Autobuilder.cs:69)
Autobuilder:AndroidProdDev() (at Assets/scripts/models/Autobuilder.cs:21)
Hmm I'm not familiar with that error. It sounds like you imported the new 6.15.2 Unity package overtop of the 6.15.0 package. If that is the case, could you try importing the 6.15.2 Unity package into a Unity project that has never imported the Firebase packages?
@abeisgoat You issue looks like this one https://github.com/firebase/quickstart-unity/issues/760
Are you installing Gradle 6 in your machine? I am pretty sure Gradle 6 introduced many breaking changes that the generated Gradle project from Unity does not work with. It would be safe to stick with the one came with Unity (5.1.1 most likely)
Hi @dconeybe
I have fixed the above Gradle build failed issue by re-importing firebase packages from scratch, but that didnt solve my main issue (failed to get document from server). Also I have build a sample app to reproduce the issue, the issue is occurring in sample app also (both editor & android app), just FYI, apart from the steps given above to create & export the sample apk, I also had to change the Minify option to progaurd as I was facing below issue:
Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForRelease'.
The proguard contains below content:
-keep class com.google.unity.** {
*;
}
-keep class com.google.android.gms.ads.** {
*;
}
The sample app link I have mailed at your mail id ([email protected]), please check. That app is built in development mode. Please test this app in different devices and different network the issue is device/network specific. Thanks
Additional info: I also copied the logs from my main app, when it was crashing down.
* * * * * * * * * * * * * * * *
Build fingerprint: 'xiaomi/violet/violet:9/PKQ1.181203.001/V11.0.9.0.PFHINXM:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 29944, tid: 29979, name: UnityMain >>> com.DefaultCompany.TheCarGame <<<
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xe0434f00
Abort message: 'java_vm_ext.cc:542] JNI DETECTED ERROR IN APPLICATION: can't call java.util.Set java.util.Map.keySet() on null object'
r0 cf2f7154 r1 cf2f7260 r2 00000000 r3 e0434f00
r4 cf2f7154 r5 d0e16700 r6 00000000 r7 cf2f7260
r8 0000751b r9 cf2f7788 r10 cf2f7808 r11 cf2f7360
ip ccff677c sp cf2f6fe0 lr ccc4e384 pc e0434f00
backtrace:
#00 pc 00002f00 <anonymous:e0432000>
#01 pc 0018c380 /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libmonobdwgc-2.0.so (mono_walk_stack_full+1544)
#02 pc 0018a020 /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libmonobdwgc-2.0.so (mono_walk_stack_with_state+308)
#03 pc 0018c588 /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libmonobdwgc-2.0.so (mono_walk_stack+64)
#04 pc 00973a1f /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libunity.so (NativeRuntimeException::signal_handler(int, siginfo*, void*)+334)
#05 pc 0025e5b8 /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libmonobdwgc-2.0.so (mono_chain_signal+180)
#06 pc 0025e714 /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libmonobdwgc-2.0.so (__krait_sigabrt_signal_handler+148)
#07 pc 00019b88 /system/lib/libc.so
#08 pc 0001d052 /system/lib/libc.so (abort+58)
#09 pc 003583af /system/lib/libart.so (art::Runtime::Abort(char const*)+798)
#10 pc 0000740d /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+500)
#11 pc 00236a0f /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1246)
#12 pc 00236b67 /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+58)
#13 pc 000c574d /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::AbortF(char const*, ...)+48)
#14 pc 000c87b9 /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::CheckMethodAndSig(art::ScopedObjectAccess&, _jobject*, _jclass*, _jmethodID*, art::Primitive::Type, art::InvokeType)+1120)
#15 pc 000c750f /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::_va_list, art::Primitive::Type, art::InvokeType)+566)
#16 pc 000b7f53 /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallObjectMethodV(JNIEnv*, _jobject*, _jmethodID*, std::_va_list)+42)
#17 pc 00155575 /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libFirebaseCppApp-6_15_2.so (_JNIEnv::CallObjectMethod(_jobject*, _jmethodID*, ...)+16)
#18 pc 00185e1f /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libFirebaseCppApp-6_15_2.so (firebase::firestore::FieldValueInternal::map_value() const+106)
#19 pc 0018459d /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libFirebaseCppApp-6_15_2.so (firebase::firestore::DocumentSnapshotInternal::GetData(firebase::firestore::DocumentSnapshot::ServerTimestampBehavior) const+76)
#20 pc 0017ea11 /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libFirebaseCppApp-6_15_2.so (firebase::firestore::DocumentSnapshot::GetData(firebase::firestore::DocumentSnapshot::ServerTimestampBehavior) const+6)
#21 pc 0017a1b3 /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libFirebaseCppApp-6_15_2.so (firebase::firestore::csharp::ConvertSnapshotToFieldValue(firebase::firestore::DocumentSnapshot const&, firebase::firestore::DocumentSnapshot::ServerTimestampBehavior)+14)
#22 pc 0017a175 /data/app/com.DefaultCompany.TheCarGame-u4iO3M8Hhdb-cGoS4YYcFg==/lib/arm/libFirebaseCppApp-6_15_2.so (Firebase_Firestore_CSharp_ConvertSnapshotToFieldValue+20)
#23 pc 00009a76 <anonymous:c0d86000>
Hi @ashokdamani. I'm glad you were able to solve the gradle issue. My apologies for forgetting to mention that you need to enable ProGuard minification. I had to do that as well.
Unfortunately, due to security protocols, I will not be able to execute the APK file that you sent me. But looking at the crash, it looks like another manifestation of a similar, recently-reported crash: https://github.com/firebase/quickstart-unity/issues/757. This has been logged internally as b/168117924 and is being investigated. The bug has to do with accidental usage of a moved-from DocumentSnapshot object in C++. The fix should be in the next release, although I do not know when that will be. There is no known workaround for it.
Were you experiencing this crash prior to upgrading the Unity SDK from 6.15.0 to 6.15.2? Your original description of the issue mentions the "Could not reach cloud firestore backend" error but nothing about a crash.
The crash was happening earlier also, but it wasn't frequent. So no there are two issues, one is the often crash and another is "Could not reach cloud firestore backend" error but nothing about a crash." Both the above issues occurs while fetching the data from firestore.
Ok. Let's use this ticket to tackle the "Could not reach Cloud Firestore backend" issue. The crash is logged as #757.
Please modify the sample code to call FirebaseFirestore.LogLevel = LogLevel.Debug immediately after the line FirebaseFirestore.GetInstance(firebaseApp);. This will ensure that detailed logs are produced. Then, please re-run the sample app and reproduce the "Could not reach Cloud Firestore backend" issue. After reproducing, capture the entire logcat via adb logcat -d and attach the entire resulting logs so that I can comb through them. If you make any other changes to the sample code that I posted earlier then please post those as well. It will be essential that that logs match the source code in order to diagnose this issue. Thanks!
Hey @ashokdamani. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!