React Native app crashing after downloading from google play store

Viewed 627

SOFTWARE/ CODE

I am using react native with amplify library to build my mobile app. I am using Amazon AWS as the back end for my app. Below is package.json:

{
  "name": "appname",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@aws-amplify/cache": "^3.1.55",
    "@aws-amplify/core": "^3.8.22",
    "@react-native-async-storage/async-storage": "^1.15.4",
    "@react-native-community/netinfo": "^6.0.0",
    "@react-native-picker/picker": "^1.15.0",
    "amazon-cognito-identity-js": "^4.6.0",
    "aws-amplify": "^3.3.27",
    "aws-amplify-react-native": "^4.3.2",
    "jail-monkey": "^2.5.0",
    "obfuscator-io-metro-plugin": "^1.0.2",
    "react": "17.0.1",
    "react-native": "0.64.0",
    "react-native-android-image-cropper": "^0.2.4",
    "react-native-device-info": "^8.1.3",
    "react-native-exception-handler": "^2.10.10",
    "react-native-image-pan-zoom": "^2.1.12",
    "react-native-keychain": "^7.0.0",
    "react-native-rsa-native": "^2.0.3",
    "react-native-sms-retriever": "^1.1.1",
    "react-native-splash-screen": "^3.2.0",
    "react-native-uuid": "^2.0.1",
    "react-native-vector-icons": "^8.1.0",
    "rn-fetch-blob": "^0.12.0",
    "rn-test-exception-handler": "^1.3.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "7.14.0",
    "jest": "^26.6.3",
    "jetifier": "^1.6.8",
    "metro-react-native-babel-preset": "^0.64.0",
    "react-test-renderer": "17.0.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

WHAT IS WORKING:

During development - I have built my app and have ran on actual physical device and it runs successfully.

I have built my app using both the commands-

./gradlew assembleRelease    // generates apk
./gradlew bundleRelease      // generates aab

I have transferred both apk and aab (separately one by one) on my physical mobile device, the app runs successfully for both cases.

WHAT IS NOT WORKING:

I have followed the steps exactly as mentioned in the docs: https://reactnative.dev/docs/signed-apk-android

I have then uploaded my app on playstore and then my app after review goes to production successfully.

After this I download the app from the google playstore on the same mobile device. The app opens and then shuts down - it says "appname keeps stopping". How can I solve this crash?

AndroidManifest.xml:

This is my FINAL AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.appname"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="21"
        android:targetSdkVersion="30" />

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <!-- Required by older versions of Google Play services to create GCM registration tokens -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- Required to access Google Play Licensing -->
    <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
    <uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
    <uses-permission android:name="android.permission.USE_BIOMETRIC" />
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />

    <application
        android:name="com.appname.MainApplication"
        android:allowBackup="false"
        android:appComponentFactory="androidx.core.app.CoreComponentFactory"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:requestLegacyExternalStorage="true"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.appname.MainActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustResize" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
            android:theme="@style/Base.Theme.AppCompat" />
        <activity android:name="com.masteratul.exceptionhandler.DefaultErrorScreen" >
        </activity>

        <provider
            android:name="com.RNFetchBlob.Utils.FileProvider"
            android:authorities="com.appname.provider"
            android:exported="false"
            android:grantUriPermissions="true" >
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

        <activity
            android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
            android:excludeFromRecents="true"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <!--
            Service handling Google Sign-In user revocation. For apps that do not integrate with
            Google Sign-In, this service will never be started.
        -->
        <service
            android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
            android:exported="true"
            android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />

        <activity
            android:name="com.google.android.gms.common.api.GoogleApiActivity"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    </application>


0 Answers
Related