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

64-bit compliance issue even after updating to "react-native": "^0.59.3" #25362

Closed
GaneshSaiKumar opened this issue Jun 22, 2019 · 6 comments
Closed
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@GaneshSaiKumar
Copy link

React Native version: 0.59.3
Describe what you expected to happen:

after seeing this 64-bit compliance issue i updated react native version to 0.59.3 and submitted app to playstore and got same warning about 64-bit compliance.

@dulmandakh
Copy link
Contributor

Could you please share contents of android/app/build.gradle?

@Mubashirkhan
Copy link

splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } }

we are still getting 64-bit compliance after upgrading to react-native 0.59.5 as per my understanding this is what really gets updated for 64-bit compliance in build.gradle file if there are any more updates need in build.gradle file please mention

@OmranElmasry
Copy link

OmranElmasry commented Jul 12, 2019

You will need to update in a few spots in app/build.gradle,

splits {
        abi {
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" // HERE u need to add "arm64-v8a", "x86_64"
        }
    }

also

applicationVariants.all { variant ->
        variant.outputs.each { output ->
            def versionCodes = ["x86":1, "armeabi-v7a":2, 'arm64-v8a':3, 'x86_64':4] // HERE do the same and dont forget the numbers
        }
    }

and finally if you are using ENV staging

if (System.getenv("ENV") == 'staging') {
    android.defaultConfig.ndk {
        abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' // HERE 
    }
}

@devrahuldataman
Copy link

devrahuldataman commented Aug 22, 2019

I am still getting this issue. I upgraded 0.57 to 0.59. It is working fine with ABI x86 (32) bit.
gradle is here


project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.redmilgroup"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 35
        versionName "2.8.4"
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-image-resizer')
    implementation project(':react-native-fetch-blob')
    implementation project(':react-native-gesture-handler')
    implementation project(':react-native-fs')
    implementation project(':react-native-device-info')
    implementation project(':react-native-exception-handler')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

@xwartz
Copy link

xwartz commented Sep 6, 2019

I have the same issue, after adding 'armeabi-v7a','arm64-v8a','x86','x86_64'

@xwartz
Copy link

xwartz commented Sep 6, 2019

solved it by using ./gradlew bundleRelease instead of ./gradlew assembleRelease

https://facebook.github.io/react-native/docs/signed-apk-android#generating-the-release-apk

@facebook facebook locked as resolved and limited conversation to collaborators Jun 25, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants