-
Notifications
You must be signed in to change notification settings - Fork 528
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
Firestore "DEADLINE_EXCEEDED" error in Release, but not in Debug mode #8378
Comments
This is unlikely to be a problem with Xamarin.Android, the error appears to be server side. Please check some solutions suggested elsewhere:
If you still think this is caused by some issue in Xamarin.Android, please provide logs gathered by issuing the following commands at the developer prompt: > adb shell setprop debug.mono.level default,assembly,timing=bare,mono_log_level=debug,mono_log_mask=all
> adb logcat -G 16M
> adb logcat -c
rem Run the application here and wait for the error to occur, then wait a few seconds more followed by:
> adb logcat -d > logcat.txt And attach the resulting |
I'm afraid I didn't pay attention and I gave a wrong error. The right one is: |
Checking generated code in:
Found code: // Metadata.xml XPath field reference: path="/api/package[@name='com.google.firebase.firestore']/class[@name='FirebaseFirestoreException.Code']/field[@name='DEADLINE_EXCEEDED']"
[Register ("DEADLINE_EXCEEDED")]
public static global::Firebase.Firestore.FirebaseFirestoreException.Code DeadlineExceeded {
get {
const string __id = "DEADLINE_EXCEEDED.Lcom/google/firebase/firestore/FirebaseFirestoreException$Code;";
var __v = _members.StaticFields.GetObjectValue (__id);
return global::Java.Lang.Object.GetObject<global::Firebase.Firestore.FirebaseFirestoreException.Code> (__v.Handle, JniHandleOwnership.TransferLocalRef);
}
}
This (Release crash, Debug OK) indicates that R8/proguard caused removal of that field (very high probability). Try adding proguard rules to the app. |
@moljac |
OK. This would keep all Firebase stuff. Maybe too much. Can you try Something like:
Start with that and increase specificity until
maybe (note
Some samples https://gist.github.com/lingarajsankaravelu/db4dae89dcbc5b5346a0154791802af5 |
BTW which version of Firestore do yo use? |
Actually after a couple of tries the error changed, so the rule worked. (Maybe a cached version of the app ran initially?) Now the error is: I will address the issue of the generic rule I used after solving the new error. I will try to use the most specific one, but my priority is to fix the last error. By the way, I use version 3.3.0. |
As for the new error, it is definitely an error that happens during linking. When I set the linking to "None" it vanishes. I'm not sure how to deal with it though. |
Can you provide more info please;
|
Here you go:
|
Do you have logcat? |
@CostasAthan: reiterating @moljac 's comment, do you have full(er) In particular, this part of your most recent comment leaves me wanting more:
In particular, I want the full exception output for the nested |
How can I get the data you suggest? In Release mode I don't see any errors through the IDE and the error happens only in Release configuration. |
Running the app on Debug mode with linking enabled I get the following 2 unhandled exceptions:
Here is the line that causes the 1st one:
That's the file that models the database's fields. Here is my code:
When I hit the "Continue" button I get the following error:
All these happen when linking is enabled. Disabling the linking makes the errors to vanish. |
A few things to add... The error in Release mode happens also with linking set to "Sdk Assemblies Only", so I guess it does not come from nugget packages, right? Furthermore, even though I have enabled debugging in the Release configuration ("Enable developer instrumentation (debugging and profiling)"), trying to follow @jonpryor suggestion, I get this message in Visual Studio:
Anyway, I have enabled linking in Debug mode. I hope the results are equivalent. In this message I have listed the errors I get with Debug configuration when linking is enabled: #8378 (comment) edit: The errors in Debug mode happen only when the linking is set to "Sdk and User Assemblies", in contrast with Release mode in which the error arises regardless if linking is set to "Sdk Assemblies Only" or "Sdk and User Assemblies". |
By using the Then, before launching your app, run: adb logcat > log.txt then run your app. Once your app has crashed, return to the |
The linker and reflection don't always mix well. My assumption is that this expression: myDocument.ToObject<DatabaseFields>() involves Reflection, and tries to use the The fix for this is one of:
(3) can be done via custom attributes such as
Similar to my other question regarding exceptions, the nested exception is hugely important, and is missing here. What exception did |
I think here is the relevant part of the log file.
|
With support for Classic Xamarin.Android ended May 1st, 2024, this issue is likely no longer relevant. If this still persists in .NET 8+, please open a new issue with updated information based on |
Android application type
Classic Xamarin.Android (MonoAndroid12.0, etc.)
Affected platform version
VS 2022 17.7.4
Description
The Android app of a Xamarin.Android project I develop gives a "DEADLINE_EXCEEDED" error when run under "Release" configuration, but runs without any issues in "Debug" mode.
The error happens both on physical devices and when using the emulator. I also have tried different Android API levels (both on phones and on the emulator), but that makes no difference.
Steps to Reproduce
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: