I have incorporated crashlytics in my react native app. Everything works well for android but for some weird reason, iOS fails to work.
The issue
crashlytics().crash() method doesnt invoke crashes as it says in the logs:
Crashlytics collection is not enabled, not crashing
I have added a firebase.json file to my project's root folder with this values as recommended by the documentation to send crashes to the console via debug mode.
{
"react-native": {
"crashlytics_debug_enabled": true,
"crashlytics_disable_auto_disabler": true,
"crashlytics_auto_collection_enabled": true,
"crashlytics_is_error_generation_on_js_crash_enabled": true,
"crashlytics_javascript_exception_handler_chaining_enabled": true
}
}
You can see that crashlytics debug enable is true, yet it fails to work for me and still says its not enabled, - when it is.
This is a really frustrating experience for me. What can I do?
Related
I am building a React Native app and it works fine in debug mode, but when I try to build it in release mode, it shows a blank screen. I have tried several things to troubleshoot the issue, such as updating my dependencies and checking for any syntax errors, but I haven't been able to find the cause of the problem. I am not seeing any error messages, and the app seems to be working as expected in debug mode.
I am not sure what is causing the issue in release mode, and I would appreciate any help or suggestions.
Here is what I have tried so far:
I have checked that my React Native dependencies are up-to-date and correctly configured.
I have ensured that the bundle is being correctly packaged in the binary APK.
I have verified that there are no syntax errors in my code.
Use this error handler https://github.com/a7ul/react-native-exception-handler to catch problems in production. It supports both JS and Native side errors
I have a MacBook Air, and while it can perfectly compile and run ReactNative projects on Android device, I noticed that the MBA will become so hot in no time if the Metro server is run. If it's hot, even the IDE (Visual Studio Code) is lagging like 2-5s when I'm trying to type anything.
Is it possible for me to compile, run ReactNative project, and also debug it from Mac's browser, without running Metro server on my Mac? (like, for example, actually bundle the server into the app like when we release production APK -- but still enabling me to get console output on browser?)
EDIT: currently I have already added bundleInDebug: true, save, and then retry npx react-native run-android, but it still does the "Starting JS server..." thing. Closing the server terminal window makes the app crash, so I guess the app still depends on the Metro server on the computer. It's almost like the bundleInDebug option gets ignored.
Yes, you can. Just edit android/app/build/gradle. Search for these lines
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
]
And add bundleInDebug: true after enableHermes line.
If you have custom build variant, the configuration property can be in the following formats:
bundleIn${productFlavor}${buildType}
bundleIn${buildType}.
For example bundleInFreeDebug: true, bundleInPaidRelease: true, bundleInBeta: true
EDIT:
JS debugger works only with Metro server
React Native App crashes if signed and released. Works fine in debug mode. It doesn't throw any error in the screen. It simply crashes. When I looked at cat log. no error.
I also tried build apk with --info, but no additional info while crashing. I also tried building APK by setting minifyEnabled false.
When run the app in debug mode by connecting my phone via USB, it works.
I'm tried creating apk with --debug but I'm unable to install it my phone, it says parsing error when I try to install using app installer.
I got the following logcat errors. What does it mean?
09-03 11:03:07.968 W/ActivityManager(1344): Force finishing activity com.myapp/.MainActivity
09-03 11:03:08.012 W/BroadcastQueue(1344): Skipping deliver [background] BroadcastRecord{cb72147 u-1 android.net.conn.CONNECTIVITY_CHANGE} to ReceiverList{7bf2161 22421 com.myapp/10100/u0 remote:b9cdcc8}: process crashing
09-03 11:03:08.035 W/ActivityManager(1344): Dismiss app error dialog : com.myapp
09-03 11:03:13.095 I/WindowState(1344): WIN DEATH: Window{3f22c22 u0 /com.myapp.MainActivity}
I finally found the cause. There is module called react-native-material-design-searchbar which was causing the issue. The weird part is, if directly copy the SearchBar.js from that module and use it all works fine even in release, but if use module as direct import it's not working only in release mode. So weird. The SearchBar is good, so now I'm using directly by copying the file to my project.
I fixed this error by uninstalling uglifyjs and reinstalled the latest (using NPM).
I'va a react native app in development, it work without any problems on ios and android in debug, but when i try to make a signed apk or a archive with the jsbundle direclty in the app instead of the dev server, the app is stuck on my first screen (custom loading screen). it work fine in debug with the jsbundle directly in the app.
I'm using react-native 0.24.1. tried to upgrade to 0.28 and it still stuck.
in short
DEBUG : code in react server console => Work fine
DEBUG : jsbundle in the app => Work fine
RELEASE : code in react server console => Work fine
RELEASE : jsbundle in the app => stuck on first screen (no crash)
If anyone has a idee how i can debug this.
I built an application using Sencha Touch 2 "Building Sencha native application." The application is built and the IOS simulator is a success. However, the application remains on the page with a load indicator (three blinking dots). No error or warning. The application loads and works fine in Chrome browser.
Any suggestions please?
I hope you found the solution. If not, following is my suggestion.
I was stuck in same issue.
It killed my excitement to run the app in simulator[Because there were no errors to deal with, clueless what was wrong]. Searched sencha's ambiguous documentation and forums and found the following fix:
Step 1: Open app.json file.
Step 2: Search for:
/**
* Build options
*/
"buildOptions": {
"product": "touch",
"minVersion": 3,
"debug": false,
"logger": "no"
},
Step 3: Change the last line "logger":"no" to "logger":false
I have not found an answer why this needs to be changed. Might be they have changed the value for the configuration keyword in the SDK but not updated here in app.json [ If somebody can help to understand why, it would be great]. I am not sure. But that worked for me. I was able to test the app in iOS simulator.
I have not tested on Android simulator and actual devices yet.
Hope this helps!.
Thanks.
I'm fighting with what could be the same problem and it seems to be due to it trying to load various files, even though the contents of them have been bundled into app.js. You can see if this is your problem by looking for red files in the Resource tab of the web inspector.
You can also check iOS Simulator logs:
iOS Simulator -> Debug -> Open System Log ...
Might tell you that some entries in comfig.xml are missing