Earlier quoted context omitted.
That's an interesting idea. The code to select and resize the images are native third-party plugins so in this case I am not sure anything more could be done. I thought maybe the problem was that the app had to switch to another app to select the image. I reimplemented the code using a pure JavaScript plugin based on React Native's CameraRoll API to avoid switching apps and it still crashed when the image was selecte…
Just a wild guess - you said opening for processing. Depending on what you're doing with the file and how you're opening it the whole data get's passed over the bridge resulting in some catastrophic memory allocations. I would recommend tapping into the bridge communication and start checking if everything stays where it should. Some picker modules tend to send base64 encoded file beside the URL.
Tempted to Abandon React Native for Native Android
21–30 of 63 posts
Re: Tempted to Abandon React Native for Native Android
#22If you already know how to do the image related task in Native Android, you could spike a test project and verify that it's performant on the smaller devices and the problem could be attributed to React Native alone. Then it's a matter of porting the high level API to JS. Given that you believe this is a memory-related problem, perhaps it's because the image is too large to fit into the available memory, and having R…
I did just that. I created a native Android project that selected an image from the image picker and displayed it in an image view. I tested it with a few images and it worked. Even the image that crashed the React Native app. "Given that you believe this is a memory-related problem, perhaps it's because the image is too large to fit into the available memory, and having React Native made it worse. " This is precisel…
Re: Tempted to Abandon React Native for Native Android
#23If you already know how to do the image related task in Native Android, you could spike a test project and verify that it's performant on the smaller devices and the problem could be attributed to React Native alone. Then it's a matter of porting the high level API to JS. Given that you believe this is a memory-related problem, perhaps it's because the image is too large to fit into the available memory, and having R…
I did just that. I created a native Android project that selected an image from the image picker and displayed it in an image view. I tested it with a few images and it worked. Even the image that crashed the React Native app. "Given that you believe this is a memory-related problem, perhaps it's because the image is too large to fit into the available memory, and having React Native made it worse. " This is precisel…
Re: Tempted to Abandon React Native for Native Android
#24I've been playing a lot with React Native over the last year; professionally for almost 4 months now. This really aligns with my experience. I don't share the same opinion of going back to native code though. This really is a fantastic platform. You really can, today, write native cross platform and web apps with the same code base. With few exceptions, everything from including native modules to upgrading is painles…
Yep, exactly my experience. I love React Native but if your not used to the Javascript style of million's dependencies your in for a world of pain. It's critical to spend more time vetting third party React Native/Javascript libraries as the quality level varies way more than with native libraries. As a native developer I hadn't spent a lot of time working deeply with npm. One thing to be careful about when saving pa…
Re: Tempted to Abandon React Native for Native Android
#25I've been playing a lot with React Native over the last year; professionally for almost 4 months now. This really aligns with my experience. I don't share the same opinion of going back to native code though. This really is a fantastic platform. You really can, today, write native cross platform and web apps with the same code base. With few exceptions, everything from including native modules to upgrading is painles…
Yep, exactly my experience. I love React Native but if your not used to the Javascript style of million's dependencies your in for a world of pain. It's critical to spend more time vetting third party React Native/Javascript libraries as the quality level varies way more than with native libraries. As a native developer I hadn't spent a lot of time working deeply with npm. One thing to be careful about when saving pa…
React Native is a great platform but it's still very fragile, particularly on Android.
Re: Tempted to Abandon React Native for Native Android
#26To summarize this article: The author really enjoyed using React Native up until he hit some performance issues related to loading large images on certain versions of Android. He doesn't go into what specifically the performance issues were, any techniques he used to profile his app, what third party libraries he tired or anything. Performance issues happen all the time with native apps that don't use React Native. O…
Would definitely be interested.
Re: Tempted to Abandon React Native for Native Android
#27Earlier quoted context omitted.
Just a wild guess - you said opening for processing. Depending on what you're doing with the file and how you're opening it the whole data get's passed over the bridge resulting in some catastrophic memory allocations. I would recommend tapping into the bridge communication and start checking if everything stays where it should. Some picker modules tend to send base64 encoded file beside the URL.
The first module I tried was react-native-image-picker and yes it returns an object with base64 encoded data. What I do with this data is first, resize the image then display the resized image in an ImageView then upload the resized image to Firebase Storage.
I've been using React Native cross platform for over a year, and it has a ridiculous number of issues, but they're trade offs. There are benefits that come with it. React Native is just another tool, evaluate it as you would any other framework.
Re: Tempted to Abandon React Native for Native Android
#28To summarize this article: The author really enjoyed using React Native up until he hit some performance issues related to loading large images on certain versions of Android. He doesn't go into what specifically the performance issues were, any techniques he used to profile his app, what third party libraries he tired or anything. Performance issues happen all the time with native apps that don't use React Native. O…
I analysed react-native's performance issues with images and out-of-memory-errors a while back. Their (and their image library Fresco's) problem is that they make heavy use of object-finalizers, which is an error in Java and especially Android. I reported a couple of bugs, but got dismissed: https://github.com/facebook/react-native/issues/8711 https://github.com/facebook/react-native/issues/8780 https://github.com/fa…
Facebook's tools for Android are generally written in a way that you get the feeling one could only justify by repeating the manta "We're Facebook, these are Facebook scale problems" the whole time writing you're them. (see: Redex vs just Proguard)
Wether they 're problems worth solving again need not be evaluated.
Re: Tempted to Abandon React Native for Native Android
#29Re: Tempted to Abandon React Native for Native Android
#30Earlier quoted context omitted.
I analysed react-native's performance issues with images and out-of-memory-errors a while back. Their (and their image library Fresco's) problem is that they make heavy use of object-finalizers, which is an error in Java and especially Android. I reported a couple of bugs, but got dismissed: https://github.com/facebook/react-native/issues/8711 https://github.com/facebook/react-native/issues/8780 https://github.com/fa…
Fresco is extremely notorious for causing crashes, I had no idea React Native used it. Picasso and Glide are the two sensible choices for image loading. Facebook's tools for Android are generally written in a way that you get the feeling one could only justify by repeating the manta "We're Facebook, these are Facebook scale problems" the whole time writing you're them. (see: Redex vs just Proguard) Wether they 're pr…