Skip to content

Poor performance in Android production build #17033

Description

@BG687

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
npm: 4.2.0
Watchman: 4.6.0
Android Studio: 2.3.3

Packages: (wanted => installed)
react: 15.6.1 => 15.6.1
react-native 0.50.3 => 0.50.3
react-redux: 5.0.6 => 5.0.6
redux: 3.7.2 => 3.7.2,

Steps to Reproduce

So, my react-native app's performance is good in production mode in iOS -- native-feeling transitions, smooth animations, etc. However, on Android, we have serious performance issues -- multi-second delays for simple transitions, choppy animations, etc. The app is basically great in iOS and not usable in Android.

We have tried to follow the react native performance docs. We have taken out all the console logs, swapped ListViews with FlatViews and SectionViews, made animations useNativeDriver, etc.

We have also followed the guides for building in production mode -- turn debuggable to false in the app's build.gradle, set the build-variant to release, generate a signed APK with a keystore .jks file, etc. etc.

We have tested Android performance on the emulator and on two devices -- on a new Galaxy S8 and a 2013 Nexus 7 tablet. The performance is poor on both devices. We have deleted the cache, uninstalled the app, cleaned the build folder, and rebuilt many times.

Any ideas on how to fix this? It is odd that there is such a big performance hit in Android, and we are thinking there could be something easily remedied that we are missing.

(Write your steps here:)

  1. Improve react native performance in line with docs
  2. Change build gradle files and build variant to prepare for production build
  3. Generate signed APK
  4. Test on device

Expected Behavior

We thought performance in Android would be similar to the performance of production builds in iOS

Actual Behavior

Performance is very slow, as described two sections above.

Reproducible Demo

Since this is an issue related to building in Android Studio, a demo may not be very useful here. Just note that ALL transitions are very slow in Android but normal / fast in iOS. We have tried using different navigation libraries, including react-navigation, but that has not helped with this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions