'expo map and camera are not working after building apk React Native but working fine during Development and testing

When I’m testing my app inside expo app everything works perfect! But, when i build a android binary using expo build:android the camera and camera roll stop working. I get the grant permission message, but nothing's happening.

{
  "expo": {
    "name": "FRSC",
    "slug": "reportApp",
    "version": "1.0.2",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.ApikoSoftware.multimediaNotes",
      "infoPlist": {
        "NSLocationWhenInUseUsageDescription": "The Beep App uses your location to pick origins, destinations, and predict ride times",
        "NSLocationAlwaysUsageDescription": "The Beep App will use your location to provide ETA's to yourself and others",
        "UIBackgroundModes": [
          "location",
          "fetch"
        ]
      }
    },
    "android": {
      "package": "reportApp.app",
      "versionCode": 1,
      "permissions": [
        "ACCESS_BACKGROUND_LOCATION",
        "ACCESS_FOREGROUND_LOCATION",
        "RECORD_AUDIO",
        "ACCESS_COARSE_LOCATION",
        "ACCESS_FINE_LOCATION",
        "CAMERA"
      ],
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "description": ""
  }
}

Anybody help me, please.



Solution 1:[1]

The expo map need api key in app.json to run map in standalone applications.

For the camera in expo android when build with expo build: android it’s have problem with the build.

I manually build the application with eject it and build it with my local machine and the camera work perfect

Solution 2:[2]

For expo maps you need to follow the steps described on Deploying Google Maps to Android for maps to work on your APK build.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Altommy
Solution 2 tmndungu