Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Add support for split build per architecture #5160

Closed
wants to merge 1 commit into from
Closed

[Android] Add support for split build per architecture #5160

wants to merge 1 commit into from

Commits on Jan 7, 2016

  1. [Android] Add support for split build per architecture

    This allows everyone to deploy significantly smaller APKs
    by building separate APKs for ARM, x86 architectures.
    
    For a simple app, Both ARM, x86 APKs are about 4MB which is
    about 50% reduction compared to the universal APK.
    
    Test Plan:
    
    Created a sample project, uncommented `// include "armeabi-v7a", 'x86'`.
    
        cd android
        ./gradlew assembleDebug
    
    Three APKs were created, unzipped each: one has only x86 binaries,
    one has ARM binaries, one has both.
    
        ./gradlew assembleRelease
    
    Three APKs were created, JS bundle is correcly added to assets.
    
        react-native run-android
    
    The correct APK is installed on the emulator and the app runs
    (Gradle output: "Installing APK 'app-x86-debug.apk'").
    
    With the line commented out the behavior is exactly the same as before,
    only one universal APK is built.
    
    Checked that version codes are set correctly as decribed in
    http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
    http://developer.android.com/intl/ru/google/play/publishing/multiple-apks.html
    
        aapt l -a ../android/app/build/outputs/apk/app-armeabi-v7a-debug.apk | grep android:version
            A: android:versionCode(0x0101021b)=(type 0x10)0x100001
            A: android:versionName(0x0101021c)="1.0" (Raw: "1.0")
    
        aapt l -a ../android/app/build/outputs/apk/app-x86-debug.apk | grep android:version
            A: android:versionCode(0x0101021b)=(type 0x10)0x200001
            A: android:versionName(0x0101021c)="1.0" (Raw: "1.0")
    
        aapt l -a ../android/app/build/outputs/apk/app-universal-debug.apk | grep android:version
            A: android:versionCode(0x0101021b)=(type 0x10)0x1
            A: android:versionName(0x0101021c)="1.0" (Raw: "1.0")
    Martin Konicek committed Jan 7, 2016
    Configuration menu
    Copy the full SHA
    0a279c0 View commit details
    Browse the repository at this point in the history