loopj / airbrake-android Goto Github PK
View Code? Open in Web Editor NEWAirbrake Notifier for Android
Home Page: http://loopj.com/airbrake-android/
Airbrake Notifier for Android
Home Page: http://loopj.com/airbrake-android/
When i tired to integrate AirbrakeNotifier, i got an exception in this line:
AirbrakeNotifier.register(this, api_key);
Here are my logcat:
10-17 01:23:18.136: E/AndroidRuntime(482): FATAL EXCEPTION: main
10-17 01:23:18.136: E/AndroidRuntime(482): java.lang.NoClassDefFoundError: com.loopj.android.airbrake.AirbrakeNotifier
10-17 01:23:18.136: E/AndroidRuntime(482): at com.appoxy.timedroid.free.TimeDroid.initAirbrakeNotifier(TimeDroid.java:139)
10-17 01:23:18.136: E/AndroidRuntime(482): at com.appoxy.timedroid.free.TimeDroid.onCreate(TimeDroid.java:124)
10-17 01:23:18.136: E/AndroidRuntime(482): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-17 01:23:18.136: E/AndroidRuntime(482): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
10-17 01:23:18.136: E/AndroidRuntime(482): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
10-17 01:23:18.136: E/AndroidRuntime(482): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
10-17 01:23:18.136: E/AndroidRuntime(482): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
10-17 01:23:18.136: E/AndroidRuntime(482): at android.os.Handler.dispatchMessage(Handler.java:99)
10-17 01:23:18.136: E/AndroidRuntime(482): at android.os.Looper.loop(Looper.java:123)
10-17 01:23:18.136: E/AndroidRuntime(482): at android.app.ActivityThread.main(ActivityThread.java:3683)
10-17 01:23:18.136: E/AndroidRuntime(482): at java.lang.reflect.Method.invokeNative(Native Method)
10-17 01:23:18.136: E/AndroidRuntime(482): at java.lang.reflect.Method.invoke(Method.java:507)
10-17 01:23:18.136: E/AndroidRuntime(482): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-17 01:23:18.136: E/AndroidRuntime(482): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-17 01:23:18.136: E/AndroidRuntime(482): at dalvik.system.NativeStart.main(Native Method)
I don't understand why i get AirbrakeNotifier null, i integrated the jar in libs!!!
My android app crashes while registering the Hoptoad notifier. This is the output on LogCat
...
05-04 17:19:57.909: DEBUG/HoptoadNotifier(8953): Registered and ready to handle exceptions.
05-04 17:19:58.129: INFO/DEBUG(27): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-04 17:19:58.129: INFO/DEBUG(27): Build fingerprint: 'generic/sdk/generic/:1.6/Donut/20842:eng/test-keys'
05-04 17:19:58.129: INFO/DEBUG(27): pid: 8953, tid: 8953 >>> com.abc.def <<<
05-04 17:19:58.129: INFO/DEBUG(27): signal 11 (SIGSEGV), fault addr 00000018
05-04 17:19:58.129: INFO/DEBUG(27): r0 00000000 r1 ffff81a0 r2 ffff7f10 r3 ffff7f10
05-04 17:19:58.139: INFO/DEBUG(27): r4 ad21490d r5 00000000 r6 ffff81a0 r7 4104baac
05-04 17:19:58.139: INFO/DEBUG(27): r8 bebf1670 r9 4104baa4 10 417451d8 fp 00002071
05-04 17:19:58.139: INFO/DEBUG(27): ip ad21490d sp bebf1650 lr ad21602b pc ad20d33a cpsr 80000030
05-04 17:19:58.239: INFO/DEBUG(27): #00 pc 0000d33a /system/lib/libnativehelper.so
05-04 17:19:58.239: INFO/DEBUG(27): #1 pc 00016026 /system/lib/libnativehelper.so
05-04 17:19:58.249: INFO/DEBUG(27): stack:
05-04 17:19:58.249: INFO/DEBUG(27): bebf1610 00000000
05-04 17:19:58.249: INFO/DEBUG(27): bebf1614 bebf1688 [stack]
05-04 17:19:58.249: INFO/DEBUG(27): bebf1618 00000000
05-04 17:19:58.249: INFO/DEBUG(27): bebf161c 001d7138 [heap]
05-04 17:19:58.249: INFO/DEBUG(27): bebf1620 00000002
05-04 17:19:58.249: INFO/DEBUG(27): bebf1624 001570c0 [heap]
05-04 17:19:58.249: INFO/DEBUG(27): bebf1628 bebf1688 [stack]
05-04 17:19:58.259: INFO/DEBUG(27): bebf162c 001d7138 [heap]
05-04 17:19:58.259: INFO/DEBUG(27): bebf1630 4001ab08 /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)
05-04 17:19:58.259: INFO/DEBUG(27): bebf1634 000000c1
05-04 17:19:58.259: INFO/DEBUG(27): bebf1638 4000cdc0 /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)
05-04 17:19:58.259: INFO/DEBUG(27): bebf163c 000000c2
05-04 17:19:58.259: INFO/DEBUG(27): bebf1640 00000000
05-04 17:19:58.259: INFO/DEBUG(27): bebf1644 00000000
05-04 17:19:58.259: INFO/DEBUG(27): bebf1648 df002777
05-04 17:19:58.259: INFO/DEBUG(27): bebf164c e3a070ad
05-04 17:19:58.259: INFO/DEBUG(27): #00 bebf1650 4000e558 /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)
05-04 17:19:58.269: INFO/DEBUG(27): bebf1654 000000c1
05-04 17:19:58.269: INFO/DEBUG(27): bebf1658 00001914
05-04 17:19:58.269: INFO/DEBUG(27): bebf165c bebf1690 [stack]
05-04 17:19:58.269: INFO/DEBUG(27): bebf1660 00000000
05-04 17:19:58.269: INFO/DEBUG(27): bebf1664 ad21490d /system/lib/libnativehelper.so
05-04 17:19:58.269: INFO/DEBUG(27): bebf1668 4104baac
05-04 17:19:58.269: INFO/DEBUG(27): bebf166c ad21602b /system/lib/libnativehelper.so
05-04 17:19:58.269: INFO/DEBUG(27): #1 bebf1670 410661d8 /dev/ashmem/dalvik-LinearAlloc (deleted)
05-04 17:19:58.269: INFO/DEBUG(27): bebf1674 0000bc60 [heap]
05-04 17:19:58.269: INFO/DEBUG(27): bebf1678 ad21490d /system/lib/libnativehelper.so
05-04 17:19:58.279: INFO/DEBUG(27): bebf167c 4000cdc0 /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)
05-04 17:19:58.279: INFO/DEBUG(27): bebf1680 410661d8 /dev/ashmem/dalvik-LinearAlloc (deleted)
05-04 17:19:58.279: INFO/DEBUG(27): bebf1684 00003eeb
05-04 17:19:58.279: INFO/DEBUG(27): bebf1688 bebf1690 [stack]
05-04 17:19:58.279: INFO/DEBUG(27): bebf168c ad040b11 /system/lib/libdvm.so
05-04 17:19:58.279: INFO/DEBUG(27): bebf1690 4104baa4
05-04 17:19:58.279: INFO/DEBUG(27): bebf1694 4185ce97 /data/dalvik-cache/system@framework@[email protected]
05-04 17:19:58.289: INFO/DEBUG(27): bebf1698 ad21490d /system/lib/libnativehelper.so
05-04 17:19:58.289: INFO/DEBUG(27): bebf169c bebf1708 [stack]
05-04 17:19:58.289: INFO/DEBUG(27): bebf16a0 bebf1708 [stack]
05-04 17:19:58.289: INFO/DEBUG(27): bebf16a4 00000001
05-04 17:19:58.289: INFO/DEBUG(27): bebf16a8 ad084aa8 /system/lib/libdvm.so
05-04 17:19:58.289: INFO/DEBUG(27): bebf16ac 4104baa4
05-04 17:19:58.289: INFO/DEBUG(27): bebf16b0 4104ba94
05-04 17:19:58.289: INFO/DEBUG(27): bebf16b4 ad084aa8 /system/lib/libdvm.so
05-04 17:19:58.949: DEBUG/Zygote(29): Process 8953 terminated by signal (11)
05-04 17:19:58.949: INFO/ActivityManager(67): Process com.greatcall.medcoach (pid 8953) has died.
05-04 17:19:58.969: INFO/WindowManager(67): WIN DEATH: Window{439f3b00 com.greatcall.medcoach/com.abc.def.activity.WelcomeActivity paused=false}
When calling AirbrakeNotifier.register with null instead of a Context, you get a NPE, see below.
I'd expect to get a IllegalArgumentException telling me that Context is null. As other arguments are already checked, this seems to be have been forgotten?
java.lang.NullPointerException
at com.loopj.android.airbrake.AirbrakeNotifier.register(AirbrakeNotifier.java:140)
I'll fix it and send a pull request.
Hey James,
First, thank you for this excellent notifier. I have discovered that exceptions cause the notifier to hang on Android 3.0 tablets and also found the root cause.
Basically, Honeycomb enforces StrictMode including no network calls on the main thread. So, when the notifier attempts to send exception data (sendExceptionData), it is throwing an android.os.NetworkOnMainThreadException.
The way I got it working was to wrap the singular sendExceptionData call in a background thread, like so:
new BackgroundTask(new BackgroundTaskListener() {
@OverRide
public void onPostExecute() {
}
@Override
public void doInBackground() {
sendExceptionData(f);
}
});
Obviously, this can probably be cleaned up a bit, but it was good enough for my needs. By the way, BackgroundTask is just a little helper I wrote which extends AsyncTask. If you would like the source, feel free to send me a message.
Best regards,
Jason Arora
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.