You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法加载GMSPlacePickerViewController,请求排查Places API启用异常

Solution

I’ve dealt with this exact frustrating issue before—nothing’s more annoying than verifying the API is enabled over and over, only to get the same error. Let’s walk through the most likely fixes:

1. Make Sure You Enabled the Right API

Google has several Places-related APIs, and the iOS SDK requires the Places API for iOS specifically (not the generic Places API or Places Web Service). Hop into your Google Cloud Console, search for this exact name, and confirm it’s marked as "Enabled". It’s easy to mix these up, so don’t skip this check!

2. Validate Your API Key Restrictions

Even if the API is enabled, your key might have incorrect restrictions blocking access:

  • App Restrictions: Double-check that your iOS app’s Bundle ID is added to the key’s app restrictions (match the exact case, like com.yourteam.yourapp—even a typo here will break things).
  • API Restrictions: If you’ve set API restrictions on the key, ensure "Places API for iOS" is in the allowed list. If you restrict keys but forget to add this API, access will be blocked.

3. Wait for Google’s Propagation Time

API enablement doesn’t always take effect instantly. If you just turned on the API, give it 5-10 minutes (sometimes longer) for the change to roll out across Google’s servers before testing again.

4. Clear Xcode Cache & Rebuild

Old cached data can cause unexpected behavior:

  • Clean your project with Cmd + Shift + K
  • Delete Derived Data (go to Xcode → Preferences → Locations → Derived Data, click the arrow to open the folder, and delete everything inside)
  • Uninstall the app from your test device or simulator, then rebuild and reinstall it.

5. Confirm API Key Initialization

Don’t forget to initialize the Places SDK with your API key when the app launches. Add this to your AppDelegate’s didFinishLaunchingWithOptions method:

import GooglePlaces

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    GMSPlacesClient.provideAPIKey("YOUR_VALID_API_KEY")
    return true
}

Without this step, the SDK won’t authenticate properly, even if your key and API are set up correctly.

6. Verify You’re Working in the Correct Project

The error message references project ID 1047578903605—make sure you’re making changes in this exact Google Cloud project. It’s common to have multiple projects, so double-check you’re not modifying the wrong one.

Go through these steps one by one, and chances are the error will disappear. If you’re still stuck, feel free to share more details about your setup!


内容的提问来源于stack exchange,提问作者krishna meduri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 06:58:11