最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

react native - Google Maps API removed from my expo build - Stack Overflow

programmeradmin1浏览0评论

I'm working on a managed workflow expo app for iOS and Android. When i run the production build (either locally or with eas server) somehow the part of the android config in app.config.ts related to the API key is ignored.

So my app.config.ts has:

android: {
    adaptiveIcon: {
      foregroundImage: "./assets/icons/adaptive-icon.png",
      monochromeImage: "./assets/icons/adaptive-icon.png",
      backgroundImage: "./assets/icons/adaptive-icon-bg.png",
    },
    config: {
      googleMaps: {
        apiKey: "MY_API_KEY",
      },
    },
    package: "mypackage",
    googleServicesFile: "./certificates/production/google-services.json",
    permissions: ["ACCESS_FINE_LOCATION", "com.android.vending.BILLING"],
    newArchEnabled: false,
    softwareKeyboardLayoutMode: "pan",
  },

If i run a local build with verbose logs enabled:

eas build --platform android --local  --build-logger-level=trace

at some point from the logs i get:

[READ_APP_CONFIG]
....
"android": {
    "adaptiveIcon": {
      "foregroundImage": "./assets/icons/adaptive-icon.png",
      "monochromeImage": "./assets/icons/adaptive-icon.png",
      "backgroundImage": "./assets/icons/adaptive-icon-bg.png"
    },
    "package": "mypackage",
    "googleServicesFile": "./certificates/production/google-services.json",
    "permissions": [
      "ACCESS_FINE_LOCATION",
      "com.android.vending.BILLING",
      "android.permission.ACCESS_COARSE_LOCATION",
      "android.permission.ACCESS_FINE_LOCATION"
    ],
    "newArchEnabled": false,
    "softwareKeyboardLayoutMode": "pan"
}

The config.googleMaps.apiKey was removed from my input config. And when I run the build on my device i get the error:

API key not found.  Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml

Has anybody ever encountered this issue? I've tried searching on several places with no luck.

发布评论

评论列表(0)

  1. 暂无评论