<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Avdhut Kadam on Medium]]></title>
        <description><![CDATA[Stories by Avdhut Kadam on Medium]]></description>
        <link>https://medium.com/@kadamavdhut73?source=rss-988ff94c05c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bE-MZLEcOeHwFpLe</url>
            <title>Stories by Avdhut Kadam on Medium</title>
            <link>https://medium.com/@kadamavdhut73?source=rss-988ff94c05c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:05:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kadamavdhut73/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[React Native: Give 64 bit support to your Android App.]]></title>
            <link>https://medium.com/@kadamavdhut73/react-native-give-64-bit-support-to-your-android-app-34564059fd38?source=rss-988ff94c05c------2</link>
            <guid isPermaLink="false">https://medium.com/p/34564059fd38</guid>
            <category><![CDATA[android-apps]]></category>
            <category><![CDATA[google-play-store]]></category>
            <category><![CDATA[64-bit]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Avdhut Kadam]]></dc:creator>
            <pubDate>Tue, 27 Aug 2019 09:49:44 GMT</pubDate>
            <atom:updated>2019-08-29T05:42:52.205Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*8A65J8VOeZZErrFM0FRqZw.jpeg" /><figcaption>Need to Upgrade ReactNative version to ≥ 0.59.</figcaption></figure><blockquote><em>If you’ve initated your project in React Native version 0.59 or higher, congrats, you’re good to go, your app is 64 bit compliant</em>.</blockquote><p><em>Have you tried to upload / update your ReactNative App(</em>version less than 0.59<em>) on play store after July 31, 2019. If so, you might have seen the below error on play store</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*uyeDtEicY6SkMzIUxEuOCw.png" /></figure><p>That means your current app is compliant with Google Play 32-bit requirement only but not 64-bit. To update / upload your app, you need to add 64 bit support to app.</p><p><strong><em>DON’T WORRY! </em></strong><em>Thanks to ReactCommunity! From version 0.59, React Native added 64-bit support on Android.</em></p><p>Let’s explore the steps:</p><ul><li><strong>How to make your app 64 bit supported ?</strong></li></ul><p><em>The only and simple answer to above question is to </em><strong><em>upgrade your ReactNative App to 0.59 or higher</em></strong><em>.</em></p><ul><li><strong>How to upgrade ReactNative App to 0.59 or higher ?</strong></li></ul><p>I recommend you to upgrade your app to the latest release of the ReactNative. As of today, latest release of React Native is <strong>0.60, </strong>so I’ll go with it.</p><p>There are various ways to upgrade the ReactNative version.</p><ol><li><strong>react native upgrade command:</strong></li></ol><blockquote>This step applies only to projects that don’t use Git. Skip it if yours use it.</blockquote><p>Just run below command -</p><pre>react-native upgrade &lt;version&gt;</pre><p>This command does it’s best to upgrade ReactNative to the version you specified. Here if there are changes in native code, you may end up with breaking your app , you need to debug and find out the issue. Please follow <a href="https://facebook.github.io/react-native/docs/upgrading#upgrade-based-on-git">official document</a> for more details.</p><p><em>In my case, this way didn’t work for me, so I used second way.</em></p><p><strong>2. rn-diff-purge package:</strong></p><blockquote><em>Use this only in case the above didn’t work.</em></blockquote><p>A npm package <a href="https://github.com/pvinis/rn-diff-purge">rn-diff-purge</a> exposes ReactNative changes from a version to another version. You can just find the diff between your current and target version and simply apply the changes in your code line by line and file by file.</p><p>For e.g. Suppose you are upgrading from 0.57 to 0.60, you need to select the 0.57 as <strong>from</strong> and 0.60 as <strong>to </strong>versions. After that you will see the diffs, so you can apply the changes. Once you done with applying changes, just rebuild your project and you are upgraded.</p><p>Take a look at <strong><em>abi</em></strong> block in your app level <em>build.gradle -</em></p><pre>android {    ...   <br> <br>    splits {<br>        abi {<br>            reset()<br>            enable enableSeparateBuildPerCPUArchitecture<br>            universalApk false  // If true, also generate a universal APK<br>            include <strong>&quot;armeabi-v7a&quot;, &quot;x86&quot;, &quot;arm64-v8a&quot;, &quot;x86_64&quot;</strong><br>        }<br>    }    // In case, if you&#39;re using `ndk`<br>    defaultConfig {<br>        ndk {<br>            // Tells Gradle to build outputs for the following ABIs and package<br>            // them into your APK.<br>            abiFilters <strong>&quot;armeabi-v7a&quot;, &quot;x86&quot;, &quot;arm64-v8a&quot;, &quot;x86_64&quot;</strong><br>        }<br>    }   <br>// applicationVariants are e.g. debug, release<br>    applicationVariants.all { variant -&gt;<br>        variant.outputs.each { output -&gt;<br>            // For each separate APK per architecture, set a unique version code as described here:<br>            // <a href="https://developer.android.com/studio/build/configure-apk-splits.html">https://developer.android.com/studio/build/configure-apk-splits.html</a><br>            def versionCodes =<strong> [&quot;armeabi-v7a&quot;: 1, &quot;x86&quot;: 2, &quot;arm64-v8a&quot;: 3, &quot;x86_64&quot;: 4]</strong><br>            def abi = output.getFilter(OutputFile.ABI)<br>            if (abi != null) {  // null for the universal-debug, universal-release variants<br>                output.versionCodeOverride =<br>                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode<br>            }<br>        }<br>    }    ...}</pre><p>If you’ve noticed, previously there were only two instruction sets in abi block i.e. “armeabi-v7a”, “x86”. That means only 32-bit versions of both processors (arm &amp; x86) were present, but upgrading ReactNative version added 64-bit versions too, so now it became “armeabi-v7a”, “x86”, “arm64-v8a”, “x86_64”.</p><p>Now, your app has been upgraded to the latest version and also compliant with Google Play 64-bit requirements.</p><p><em>But wait….,</em></p><p>Once you rebuilt the app, you may find some warnings in your running app becasuse <em>ReactCommunity</em> made some major changes in 0.60 like -</p><ul><li><strong>Autolink feature -</strong></li></ul><p>From 0.60, ReactCommunity introduces <a href="https://github.com/react-native-community/cli/blob/master/docs/autolinking.md">autolink feature</a>.</p><p>If your app using any library(e.g. react-native-camera) that you linked manually or by running below command-,</p><pre>react-native link &lt;library&gt;</pre><p>then from 0.60 you don’t need to run above command. ReactNative libraries will be discovered and used by your app automatically.</p><p>In case you are using such library, you will see error in your terminal. So unlink it using below command and rebuild the project.</p><pre>react-native unlink &lt;library&gt;</pre><ul><li><strong>react-native-community -</strong></li></ul><p>Some packages from react-native has been moved to <a href="https://github.com/react-native-community">react-native-community</a>.</p><p>For e.g.</p><p>Previously, to import async-storage, NetInfo, etc. you used to do -</p><pre>import {AsyncStorage, NetInfo} from “react-native”;</pre><p>But, now these packages has been moved to ‘react-native-community’. If your app using such package, you will see warning for that.</p><p>So, to get the packages from react-native-community, you need to install it explicitely as -</p><pre>npm i @react-native-community/async-storage</pre><p>then remove the previous imports and use them as</p><pre>import NetInfo from &#39;<a href="http://twitter.com/react">@react</a>-native-community/netinfo&#39;;</pre><pre>import AsyncStorage from &#39;@react-native-community/async-storage&#39;;</pre><ul><li><strong>componentWill<em>Something</em> -</strong></li></ul><p>Some lifecycle hooks like componentWillMount, componentWillUpdate and componentWillReceiveProps are deprecated and will be removed in the next major version of React (i.e. version 17).</p><p>You can use alternative methods or temporary workarounds for these deprecated hooks as below-</p><ol><li><em>componentWillMount- </em>Use componentDidMount instead. As a temporary workaround, you can rename to UNSAFE_<em>componentWillMount. A </em><strong><em>recommended</em></strong><em> way is to </em>use the <strong>constructor()</strong> of the component class to do the stuffs of componentWillMount.</li><li><em>componentWillUpdate-</em>Use componentDidUpdate instead. As a temporary workaround, you can rename to UNSAFE_<em>componentWillUpdate.</em></li><li><em>componentWillReceiveProps-</em>Use getDerivedStateFromProps instead.</li></ol><blockquote>The lifecycle methods was renamed to make sure developers realize that there is a better way than using the <em>UNSAFE</em> method.</blockquote><p><a href="https://reactjs.org/docs/react-component.html#componentwillmount">Official Document</a></p><p><strong><em>That’s it</em>..! </strong><em>Now you’ve a 64-bit supported app with no or less warnings.</em></p><p>Now you can build your apk and upload it to Google Play Store. But let me tell you, <strong>after upgrading ReactNative version your app size might be increased to around double the previous size. </strong>It’s because now your app having code of both 32-bit and 64-bit<strong>.</strong></p><p>To reduce the app size, you have two options -</p><ol><li>Seperate builds per architecture :</li></ol><p>In your <em>android/app/build.gradle, </em>set</p><pre>def enableSeparateBuildPerCPUArchitecture = true</pre><pre>/**<br> * Run Proguard to shrink the Java bytecode in release builds.<br> */<br>def enableProguardInReleaseBuilds = true</pre><p><strong><em>enableSeparateBuildPerCPUArchitecture = true :</em></strong><em> G</em>enerates seperate apks for all architectures (“armeabi-v7a”, “x86”, “arm64-v8a”, “x86_64”). Here, apk for each architecture is built as per it’s requirements only, removes unnecessary code, resulting less app size.</p><p><strong><em>enableProguardInReleaseBuilds = true : </em></strong>It just shrinks the Java bytecode for release build and reduces the app by some size. Please test your app, if it’s breaking your app set it <strong><em>false.</em></strong></p><p>Build the apks using</p><pre>./gradlew assembleRelease</pre><p>It generates 4 apks -</p><p>32-bit &amp; 64-bit for arm processor and</p><p>32-bit &amp; 64-bit for x86 processor.</p><p>You need to upload all the apks to Play Store. Play store will take care of distributing the particular apk for each platform.</p><p>2. <strong>A</strong>ndroid <strong>A</strong>pp <strong>B</strong>undle (<strong>AAB</strong>) :</p><p>An <em>Android App Bundle</em> is a new upload format that includes all your app’s compiled code and resources, but defers APK generation and signing to Google Play.</p><p>You need to change the command you used for release build to -</p><pre>./gradlew bundleRelease</pre><p>This will generate release bundle inside</p><p><em>.../android/app/build/outputs/bundle/release/</em></p><p>Google Play’s new app serving model, called <em>Dynamic Delivery</em>, then uses your app bundle to generate and serve optimized APKs for each user’s device configuration, so they download only the code and resources they need to run your app. You no longer have to build, sign, and manage multiple APKs to support different devices, and users get smaller, more optimized downloads. You just need to upload this bundle to Google Play.</p><p>Please follow the <a href="https://developer.android.com/guide/app-bundle">official document</a> for more details.</p><p><strong><em>Congratulations..! </em></strong><em>Now you’ve an app with reasonable size which is compliant with Google Play 64-bit requirements.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34564059fd38" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>