我的礼物
implementation "com.google.android.gms:play-services-places:16.0.0"
我的清单
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/map_api_key" />
我的活动正在调用地图
PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
startActivityForResult(builder.build(this), PLACE_PICKER_REQUEST);
这是我在运行位置选择器时的日志
2019-01-01 11:57:58.771 24597-24597/com.labeyh.labeyh D/ViewRootImpl@924c3c7[AddressActivity]: ViewPostIme pointer 0
--------- beginning of system
2019-01-01 11:57:58.853 24597-24597/com.labeyh.labeyh D/ViewRootImpl@924c3c7[AddressActivity]: ViewPostIme pointer 1
2019-01-01 11:57:58.889 24597-24631/com.labeyh.labeyh V/FA: Recording user engagement, ms: 3006
2019-01-01 11:57:58.892 24597-24631/com.labeyh.labeyh V/FA: Activity paused, time: 433188100
2019-01-01 11:57:58.899 24597-24631/com.labeyh.labeyh D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=3006, firebase_screen_class(_sc)=AddressActivity, firebase_screen_id(_si)=-2529808333680378203}]
2019-01-01 11:57:58.908 24597-24597/com.labeyh.labeyh D/ViewRootImpl@924c3c7[AddressActivity]: MSG_WINDOW_FOCUS_CHANGED 0
2019-01-01 11:57:59.289 24597-24597/com.labeyh.labeyh D/InputTransport: Input channel destroyed: fd=71
2019-01-01 11:57:59.476 24597-24597/com.labeyh.labeyh D/ViewRootImpl@924c3c7[AddressActivity]: MSG_WINDOW_FOCUS_CHANGED 1
2019-01-01 11:57:59.478 24597-24597/com.labeyh.labeyh V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@c8743f1 nm : com.labeyh.labeyh ic=null
2019-01-01 11:57:59.478 24597-24597/com.labeyh.labeyh I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2019-01-01 11:57:59.483 24597-24597/com.labeyh.labeyh D/InputTransport: Input channel constructed: fd=71
2019-01-01 11:57:59.486 24597-24631/com.labeyh.labeyh V/FA: Activity resumed, time: 433188696
2019-01-01 11:58:04.489 24597-24631/com.labeyh.labeyh V/FA: Inactivity, disconnecting from the service
答案 0 :(得分:1)
如果您的API密钥不正确或您尚未通过Google控制台启用Place API,就会出现此问题。