0

click to see how the map is showing in the apk after doing eas build

this is my app.config.js

import 'dotenv/config';

const isProduction = process.env.EAS_BUILD_PROFILE === 'production';

const MAPS_KEY = isProduction
  ? process.env.EXPO_PUBLIC_GOOGLE_API_KEY
  : process.env.EXPO_PUBLIC_GOOGLE_API_KEY_DEV;

export default {
  expo: {
    name: "GlideX",
    slug: "glidex",
    version: "1.0.2",
    orientation: "portrait",
    icon: "./assets/images/icon.png",
    userInterfaceStyle: "automatic",
    scheme: "myapp",
    newArchEnabled: false,
    splash: {
      image: "./assets/images/splash.png",
      resizeMode: "contain",
      backgroundColor: "#ffffff"
    },
    updates: {
      enabled: true,
      fallbackToCacheTimeout: 0
    },
    assetBundlePatterns: ["**/*"],
    ios: {
      supportsTablet: true,
      bundleIdentifier: "com.gauravvbh.glidex",
      config: {
        googleMapsApiKey: MAPS_KEY
      },
      infoPlist: {
        NSLocationWhenInUseUsageDescription: "We need your location to show it on the map"
      }
    },
    android: {
      package: "com.gauravvbh.glidex",
      adaptiveIcon: {
        foregroundImage: "./assets/images/adaptive-icon.png",
        backgroundColor: "#ffffff"
      },
      permissions: ["ACCESS_FINE_LOCATION", "ACCESS_COARSE_LOCATION"],
      config: {
        googleMaps: {
          apiKey: MAPS_KEY
        }
      }
    },
    plugins: [
      [
        "react-native-maps-expo-plugin",
        {
          googleMapsApiKey: MAPS_KEY
        }
      ]
    ],
    extra: {
      eas: {
        projectId: "43ad45d8-f2b4-456e-a48f-cfb48faeb6aa"
      },
      googleMapsApiKey: MAPS_KEY
    },
    owner: "gauravvbh",
    web: {
      bundler: "metro",
      output: "server",
      favicon: "./assets/images/favicon.png"
    }
  }
};

i'am trying to build development apk in expo , im using react-native-maps , i have given the , apikey ,in app.json file , and enabled google maps for android too , i have given the SHA-1 key also fro the development build suggested by expo.

EXPO_PUBLIC_GOOGLE_API_KEY this key is retricted with the package name and SHA1 fingerprint EXPO_PUBLIC_GOOGLE_API_KEY_DEV this is unrestricted

this is my eas.json

{
  "cli": {
    "version": ">= 16.3.1",
    "appVersionSource": "remote"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "env": {
        "EXPO_PUBLIC_GOOGLE_API_KEY_DEV": "$EXPO_PUBLIC_GOOGLE_API_KEY_DEV"
      }
    },
    "production": {
      "autoIncrement": true,
      "env": {
        "EXPO_PUBLIC_GOOGLE_API_KEY": "$EXPO_PUBLIC_GOOGLE_API_KEY"
      }
    }
  },
  "submit": {
    "production": {}
  }
}

i also uploaded the env file in the expo cloud expo.dev

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.