-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Ti SDK 9.3.2.GA + ti.crashlytics 2.1.0 Android = NullPointerException on start up #38
Comments
I have the same issue. I was taking about it with @m1ga recently 😞 |
@phillipmovista that line was recommended as a workaround by users in the firbase native users and it should trigger a push to upload all stored exceptions. But the problem is that it is the only exception we are seeing now. Other exceptions are not logged or seen. Looks like it is not a Titanium only issue: firebase/firebase-android-sdk#1944 (comment) but hopefully we can find a way around it. There is a Sentry module https://github.com/AppWerft/Ti.Sentry which might be worth updating |
I was looking at it and wondering what caused the NullPointerException. Maybe We already have newrelic in place but we are having to jump off it since I suppose they do not support Android Ti SDK 9 |
its |
Oh, super weird. I have this running first thing in my app (to load up crashlytics) maybe that has something to do with it? Possible that it needs to check for if any exceptions exist to upload and then send them? |
normally you don't need that and it should upload logs by its own. But it stopped working so we had a look and found that issue above where other (native) people have the same issue. Have to do some more tests and check if there is any workaround or if we have to wait for the next version of crashlytics |
Sound good, thank you. I will hopefully see an updated version as well. |
You can try this version: https://migaweb.de/ti.crashlytics-android-2.1.1.zip where I removed the |
2.1.1 is acting the same for me - thanks for trying. |
wait, with the init exception again or just no results? |
init exception. still same error as above. |
that code shouldn't be in there 🤔 Try this one https://migaweb.de/ti.crashlytics-android-2.1.1b.zip perhaps I've uploaded the wrong file |
Initial tests show this is better. It did not kick out the error message at first...but I also have no way to tell if it is actually working when I have a real crash. We will keep testing. |
@phillipmovista you could run |
It does show the program crashes but then I do not see anything showing up in crashlytics after that time. |
ok, that was the initial "bug": crashlogs won't be uploaded. There was another person in the firebase repo that repots the same behavior in a native app. So it looks like its nothing we can do at the moment. |
Darn, well, thank you for letting me know. I will share this with my team since we have other apps that may be wanting this same functionality and it looks like there could be other issues with crashlytics in mobile apps. |
@m1ga any chance you can link me to that other firebase repo discussion? Also, is there anything we can do to have the |
link is mentioned here #38 (comment) The whole module code is just those lines: |
Thank you, I had overlooked that by mistake. We will keep digging from there. |
crashlytics 18.2.3 is out: along with analytics 19.0.2 If you want to give it a shot. Still not a lot of luck from my end, but wanted to share! |
Thanks for the info @petenathan42 nothing in my logs either and I don't see any release logs of 18.2.3 |
I can't really tell if this is a crashlytics issue or something funky going on with how it's integrated with titanium. You would expect an event to be created with a fatal test crash, but there's absolute silence in the firebase logs long explanation posted in the bigger thread: I am getting the: the "Persisting non-fatal event for session" occurrence, on android, creates an event file in: So after you restart the application, a report is created based on that event and then that report is sent to the firebase console. However, When I run my test crash function in the same place, but instead with a fatal crash: I'm using FYI, to get the verbose logs, run the command: to see the file system, run |
as you can see in the native thread where you've posted too: there are native people having the same issues and there was team member post that they can reproduce the error (20 Jul) but that workaround didn't really work. It will just send a new exception but not the log you'll want to have. So I don't know any solution at the moment |
I'm not sure if the issue I am having is the same one as in that native thread. It seems like they are getting events written in device storage, but the sending is failing. My problem is that a crash event isn't ever being written to the device's file system. In the example project reference by the 20 Jul comment (Jan 27), he's saying the report is failing to send depending on how late the crash occurs in the app. In my example, I'm never getting any crash data written, no matter how late in the app I run the test crash. I would be interested to know what happens in your |
I've figured out what's going on. Titanium's setDefaultUncaughtExceptionHandler is competing with the crashlytics setDefaultUncaughtExceptionHandler There can only be one default uncaught exception handler. this is the closest thing to a solution I have found. I wrote: which injects crashlytics' recordException function into titanium's exception handler. I am now getting -somewhat- useful logs in the firebase console (it works with the test crash function and real crashes in the app), but it would be really great if there was a way to use crashlytics to its full potential. Meaning, the crashlytics default uncaught exception handler runs in parallel with titanium's. By somewhat useful, I mean the only thing that ends up going to the firebase console is "error.message" Any suggestions? |
@petenathan42 nice progress, going to have a look at that. The interesting part is only: it used to work in previous versions and the Ti exception part is there since a long time tidev/titanium-sdk#10003 (the main function since the beginning). This issued started with |
try @Kroll.onAppCreate
public static void onAppCreate(TiApplication app) {
KrollRuntime.setPrimaryExceptionHandler(new TiExceptionHandler(){
@Override
public void handleException(ExceptionMessage error) {
FirebaseCrashlytics.getInstance().recordException(new Exception(error.javaStack));
super.handleException(error);
}
});
} (please post code and not a screenshot next time 😉 Makes it easier to copy) |
@phillipmovista if you want to give it a try: https://migaweb.de/ti.crashlytics-android-2.1.2.zip for the test crash you'll see
Message, Stacktrace and the where the event was fired in the module (should always be the same and not useful :) ) |
@m1ga thanks so much!! Lucky for me... @petenathan42 is working with me on this one, so I will let him pick up your suggestion today and see how it goes. 🤞 |
Just now getting back into this, I was going to try this! I thought "maybe I could build a Throwable based on the info in "error", but you beat me to it! |
@petenathan42 would you mind cleaning that up (tabs/spaces), remove the jsHeader/javaHeader to make it a bit cleaner, remove the log.i and then submit a PR? |
@m1ga |
Merged & fixed. Thanks @petenathan42 👍 |
Thank you all so much for these modules!
I am working on getting ti.crashlytics 2.1.0 into my Android app. I used the basic
require('ti.crashlytics');
in the code and I do see it going to Crashlytics in Firebase, but oddly enough, it immediately fires off a crash of:Non-fatal Exception: java.lang.Exception
This seems pretty odd since it got to Firebase okay, but then it seems to complain that something in this line is not playing well:
FirebaseCrashlytics.getInstance().recordException(new Exception());
Thanks so much!
The text was updated successfully, but these errors were encountered: