最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin4PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far