2

I've created an application in React Native that works fine in iOS. I've copied the code over to the Android portion of it, and separated out the platform-specific components. When I hit a certain component, the app crashes with an "Unfortunately has stopped".

There are no logs, no error in the console, nothing. What do I look for and where can I look? Logs? Somewhere in code?

In ~/genymotion-log/Google Nexus 6<...>-logcat.txt, I see the following:

05-15 23:50:14.379 D/OpenGLRenderer(  620): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
05-15 23:50:14.380 D/Atlas   (  620): Validating map...
05-15 23:50:14.429 I/OpenGLRenderer(  620): Initialized EGL, version 1.4
05-15 23:50:14.429 D/        (  620): HostConnection::get() New Host Connection established 0xaf31ca40, tid 1876
05-15 23:50:14.463 D/OpenGLRenderer(  620): Enabling debug mode 0
05-15 23:50:14.489 W/EGL_emulation(  620): eglSurfaceAttrib not implemented
05-15 23:50:14.490 W/OpenGLRenderer(  620): Failed to set EGL_SWAP_BEHAVIOR on surface 0x9e45dfc0, error=EGL_SUCCESS
05-15 23:50:14.490 W/EGL_emulation(  941): eglSurfaceAttrib not implemented
05-15 23:50:14.490 W/OpenGLRenderer(  941): Failed to set EGL_SWAP_BEHAVIOR on surface 0xb43e44a0, error=EGL_SUCCESS
05-15 23:50:14.952 I/ActivityManager(  620): Killing 1492:com.android.onetimeinitializer/u0a10 (adj 15): empty #17
05-15 23:50:15.219 W/OpenGLRenderer(  941): Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
05-15 23:50:15.440 W/ResourceType(  724): No package identifier when getting value for resource number 0x00000000
05-15 23:50:15.442 W/PackageManager(  724): Failure retrieving resources for com.bidsmart: Resource ID #0x0
05-15 23:50:18.400 W/AudioTrack(  620): AUDIO_OUTPUT_FLAG_FAST denied by client
05-15 23:50:18.424 I/Process ( 1805): Sending signal. PID: 1805 SIG: 9
05-15 23:50:18.463 D/OpenGLRenderer(  620): endAllStagingAnimators on 0xa1a6f780 (RippleDrawable) with handle 0xaf3be470
05-15 23:50:18.468 I/ActivityManager(  620): Process com.bidsmart (pid 1805) has died
05-15 23:50:18.472 W/InputMethodManagerService(  620): Got RemoteException sending setActive(false) notification to pid 1805 uid 10061
Nathan Hyland
  • 842
  • 2
  • 13
  • 28
  • Are you trying to connect a port in your App @Nathan Hyland. – Lips_coder May 16 '16 at 04:56
  • Not sure what that means, really. A physical port? To be clear, the app works until you hit one of the components, which has a few more nested. – Nathan Hyland May 16 '16 at 04:57
  • Yes@ Nathan Hyland – Lips_coder May 16 '16 at 04:57
  • Nope. , just showing a scroll view. – Nathan Hyland May 16 '16 at 14:03
  • When you debugging an android app, you can use command 'adb logcat' to see logs from native application layer, it's useful when locating problem – Xeijp May 17 '16 at 10:42
  • Thanks, @Xeijp. That helped. The line I found that helped me out was this: `java.lang.OutOfMemoryError: Failed to allocate a 2470012 byte allocation with 48508 free bytes and 47KB until OOM` It's saying I'm adding too many images.. I'm only adding 12 png/jpeg files to the app. My guess is they're all pushing multiple times, crashing the application. – Nathan Hyland May 19 '16 at 04:10

1 Answers1

0

No fix, but the reason is I'm pushing too much data from the server to the client. Once I ran adb logcat, I got this:

java.lang.OutOfMemoryError: Failed to allocate a 2470012 byte allocation with 48508 free bytes and 47KB until OOM.

Turns out I'm pushing my images over and over to the client until it breaks. iOS can handle it but RN can't.

Link to StackOverflow related thread: Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free bytes and 2MB until OOM

Community
  • 1
  • 1
Nathan Hyland
  • 842
  • 2
  • 13
  • 28