ianlin / react-native-firebase-crash-report Goto Github PK
View Code? Open in Web Editor NEWReact Native Firebase Crash Report With Custom Log
License: ISC License
React Native Firebase Crash Report With Custom Log
License: ISC License
36dfde3 this commit added IOS crash reporting but the README says otherwise
In RNFirebaseCrashReport.m
RCT_EXPORT_METHOD(report:(NSString *)message)
{
FIRCrashLog(message);
assert(NO); // ===> Crash.
}
Is it intented?
Installation instructions are slightly different than:
https://firebase.google.com/docs/crash/android
Specially:
Add the dependency for Crash Reporting to your app-level build.gradle file:
compile 'com.google.firebase:firebase-crash:9.2.1'
Is this a typo, or intentional?
Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/zzf;
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/zzf;```
After npm install && rnpm link and putting the dependencies inside the root level build.gradle and to the bottom of the app level build.gradle, I am getting this error:
:app:compileDebugJavaWithJavac
C:\medicall\android\app\src\main\java\co\my\package\MainActivity.java:6: error: package com
.ianlin.RNFirebaseCrashReport does not exist
import com.ianlin.RNFirebaseCrashReport.RNFirebaseCrashReportPackage;
^
1 error
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
I even tried inserting it inside the settings.gradle, but did not help neither.
React-Native : 0.40.0,
react-native-firebase-crash-report: 1.2.0,
latest google repository and play services in the android studio
Any ideas on this issue?
Thanks in advance.
I am not sure why react-native link
did not automatically add this part for me. I've got this package working in tandem with react-native-firebase-analytics, so thanks for this!
Anyway, just sharing in case someone else runs into the error where FirebaseCrash is undefined
on android, and looking to use both analytics and crash reporting together. Basically manual install instructions:
app/build.gradle
dependencies {
...
compile project(':react-native-firebase-analytics')
compile project(':react-native-firebase-crash-report') <-- add this
...
}
settings.gradle
include ':react-native-firebase-analytics'
project(':react-native-firebase-analytics').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase-analytics/android')
// add everything below this
include ':react-native-firebase-crash-report'
project(':react-native-firebase-crash-report').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase-crash-report/android')
MainApplication.java
...
import com.ianlin.RNFirebaseCrashReport.RNFirebaseCrashReportPackage; <-- add this
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new FIRAnalyticsPackage(),
...
new RNFirebaseCrashReportPackage(), <-- add this
...
);
}
i use these commands for making a log but i don't see it in firebase crash reporting panel, but if i use report method instead of log method i see it in that panel
import firebaseReort from 'react-native-firebase-crash-report';
firebaseReort.log('test')
ld: warning: directory not found for option '-L/Users/butuzgol/Library/Developer/Xcode/DerivedData/game-gotkymwjmpspvncuflounjcjojut/Build/Products/Release-iphoneos/GoogleToolboxForMac'
ld: warning: directory not found for option '-L/Users/butuzgol/Library/Developer/Xcode/DerivedData/game-gotkymwjmpspvncuflounjcjojut/Build/Products/Release-iphoneos/Protobuf'
ld: warning: directory not found for option '-L/Users/butuzgol/Library/Developer/Xcode/DerivedData/game-gotkymwjmpspvncuflounjcjojut/Build/Products/Release-iphoneos/nanopb'
ld: library not found for -lGoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hello, just want to confirm if this tool handles unhandled exceptions
automatically?
I tried a simple:
throw new Error('Something happened')
but it was not logged in our Firebase console. Did I miss something or is this a limitation of the said library? Thanks!
This is my first time integrating Firebase Crash so I hope someone can help me. My XCode stops running because of the following error:
2017-02-13 11:44:27.880900 rooplayNativeMock3[7547:1469600] Testing Firebase crash reporting....
Assertion failed: (NO), function -[RNFirebaseCrashReport report:], file /Users/annelorraineuy/projects/rooplayNativeMock3/node_modules/react-native-firebase-crash-report/ios/RNFirebaseCrashReport/RNFirebaseCrashReport.m, line 37.
warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available.
(lldb)
I am testing out this package by putting it into my app init saga. Like this:
import FirebaseCrash from 'react-native-firebase-crash-report';
export function* initApp(clientAuth, clientApi) {
...
FirebaseCrash.logcat('Testing Firebase crash reporting....');
FirebaseCrash.report('Please receive this on the console.'); // <- this line triggers it
...
}
What is this line assert(NO)
here under report for? https://github.com/ianlin/react-native-firebase-crash-report/blob/master/ios/RNFirebaseCrashReport/RNFirebaseCrashReport.m#L37
Hi,
I'm using RN30,
Is this correct or this package is only compatible with RN20?
compile 'com.facebook.react:react-native:0.20.+'?:
https://github.com/ianlin/react-native-firebase-crash-report/blob/master/android/build.gradle#L16
tks
Hi, I think it would be nicer if all console.log
calls are automatically logged for crash reporting (instead of having to call FirebaseCrash.log
).
Like this (Objective-C example):
//Add the following lines
RCTSetLogThreshold(RCTLogLevelInfo);
RCTSetLogFunction(FIRReactLogFunction);
RCTLogFunction FIRReactLogFunction = ^(
RCTLogLevel level,
__unused RCTLogSource source,
NSString *fileName,
NSNumber *lineNumber,
NSString *message
)
{
NSString *log = RCTFormatLog([NSDate date], level, fileName, lineNumber, message);
#ifdef DEBUG
fprintf(stderr, "%s\n", log.UTF8String);
fflush(stderr);
#else
FIRCrashLog(log);
#endif
int aslLevel;
switch(level) {
case RCTLogLevelTrace:
aslLevel = ASL_LEVEL_DEBUG;
break;
case RCTLogLevelInfo:
aslLevel = ASL_LEVEL_NOTICE;
break;
case RCTLogLevelWarning:
aslLevel = ASL_LEVEL_WARNING;
break;
case RCTLogLevelError:
aslLevel = ASL_LEVEL_ERR;
break;
case RCTLogLevelFatal:
aslLevel = ASL_LEVEL_CRIT;
break;
}
asl_log(NULL, NULL, aslLevel, "%s", message.UTF8String);
};
It is described in more detail here:
https://medium.com/delivery-com-engineering/add-crashlytics-to-your-react-native-ios-app-69a983a9062a#.rg68fvfs7
Nice module, but how do i get it to send a fake crash to the Firebase Console?
since none of these seems to do the job
FirebaseCrash.report('A weird thing just happened...');
FirebaseCrash.log('ERROR #39');
FirebaseCrash.logcat('ERROR #40');
FirebaseCrash.logcat('ERROR #41', '2', 'MyTag');
Hi,
I have installed the package as it's mentioned in README and although I made it work for Android, I keep trying it for iOS. After I do pod install and build&execute a Debug version everything seem to be ok but when I try to build a Release (or Archive) my project I get the following error:
bitcode bundle could not be generated because '/Users/xxx/Library/Developer/Xcode/DerivedData/ProjectName-xxx/Build/Products/Release-iphoneos/libRNFirebaseCrashReport.a(RNFirebaseCrashReport.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture armv7
I have followed this tutorial: https://medium.com/@heitorburger/static-libraries-frameworks-and-bitcode-6d8f784478a9#.pqgvekd41. I enabled bitcode and I set Other C flags in Debug to -fembed-bitcode-marker
, and Release to -fembed-bitcode
Have someone had this issue before?
Currently, the stack traces in release are very hard to read. The line-numbers refer to absolute line-numbers (and column-numbers) in the bundle.js.
Using source-maps these can be decoded to show the correct source file-name and line-number.
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.