为什么我的地图无法在新地方选择器SDK上显示



我尝试此SDK

implementation 'com.google.android.libraries.places:places:1.1.0'

这是我的代码

if (!Places.isInitialized()) {
    Places.initialize(getApplicationContext(), "YOUR_API_KEY");
}
List<Place.Field> fields = Arrays.asList(Place.Field.ID, Place.Field.NAME);
// Start the autocomplete intent.
Intent intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.FULLSCREEN, fields)
    .build(this);
startActivityForResult(intent, AUTOCOMPLETE_REQUEST_CODE);

这是我的日志猫

2019-05-21 17:21:52.921 13555-13555/com.pripun.ecom D/ViewRootImpl@50aa60a[Transaction]: ViewPostIme pointer 0
2019-05-21 17:21:53.076 13555-13555/com.pripun.ecom D/ViewRootImpl@50aa60a[Transaction]: ViewPostIme pointer 1
2019-05-21 17:21:53.172 13555-13555/com.pripun.ecom D/ViewRootImpl@4503997[AutocompleteActivity]: setView = DecorView@97eb784[AutocompleteActivity] TM=true MM=false
2019-05-21 17:21:53.172 13555-13555/com.pripun.ecom D/ViewRootImpl@50aa60a[Transaction]: MSG_WINDOW_FOCUS_CHANGED 0
2019-05-21 17:21:53.175 13555-13555/com.pripun.ecom V/InputMethodManager: Not IME target window, ignoring
2019-05-21 17:21:53.177 13555-13555/com.pripun.ecom D/ViewRootImpl@4503997[AutocompleteActivity]: dispatchAttachedToWindow
2019-05-21 17:21:53.187 13555-13555/com.pripun.ecom V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
2019-05-21 17:21:53.187 13555-13555/com.pripun.ecom D/ViewRootImpl@4503997[AutocompleteActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1080,1920] result=0x7 surface={valid=true 547448614912} changed=true
2019-05-21 17:21:53.194 13555-13602/com.pripun.ecom D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x1920]-format:1
2019-05-21 17:21:53.194 13555-13602/com.pripun.ecom D/OpenGLRenderer: eglCreateWindowSurface = 0x7f8a0190b0
2019-05-21 17:21:53.216 13555-13555/com.pripun.ecom D/ViewRootImpl@4503997[AutocompleteActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
2019-05-21 17:21:53.217 13555-13555/com.pripun.ecom D/ViewRootImpl@4503997[AutocompleteActivity]: MSG_WINDOW_FOCUS_CHANGED 1
2019-05-21 17:21:53.232 13555-13555/com.pripun.ecom V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@6a3d76 nm : com.pripun.ecom ic=com.android.internal.widget.EditableInputConnection@b3a4f77
2019-05-21 17:21:53.233 13555-13555/com.pripun.ecom I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2019-05-21 17:21:53.262 13555-13555/com.pripun.ecom D/ViewRootImpl@4503997[AutocompleteActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 72 - 0, 750) vi=Rect(0, 72 - 0, 750) or=1
2019-05-21 17:21:53.263 13555-13555/com.pripun.ecom W/View: dispatchProvideAutofillStructure(): not laid out, ignoring
2019-05-21 17:21:53.264 13555-13555/com.pripun.ecom I/chatty: uid=10658(u0_a658) com.pripun.ecom identical 3 lines
2019-05-21 17:21:53.264 13555-13555/com.pripun.ecom W/View: dispatchProvideAutofillStructure(): not laid out, ignoring
2019-05-21 17:21:53.265 13555-13555/com.pripun.ecom I/AssistStructure: Flattened final assist data: 2272 bytes, containing 1 windows, 10 views
2019-05-21 17:21:53.266 13555-13555/com.pripun.ecom W/IInputConnectionWrapper: performPrivateCommand on inactive InputConnection
2019-05-21 17:21:53.268 13555-13565/com.pripun.ecom I/zygote64: Do partial code cache collection, code=1009KB, data=632KB
2019-05-21 17:21:53.269 13555-13565/com.pripun.ecom I/zygote64: After code cache collection, code=1009KB, data=632KB
2019-05-21 17:21:53.269 13555-13565/com.pripun.ecom I/zygote64: Increasing code cache capacity to 3MB
2019-05-21 17:21:53.274 13555-13555/com.pripun.ecom D/ViewRootImpl@4503997[AutocompleteActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=true 547448614912} changed=false
2019-05-21 17:21:53.316 13555-13555/com.pripun.ecom D/ViewRootImpl@50aa60a[Transaction]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 72 - 0, 873) vi=Rect(0, 72 - 0, 873) or=1
2019-05-21 17:21:53.317 13555-13555/com.pripun.ecom D/ViewRootImpl@4503997[AutocompleteActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 72 - 0, 873) vi=Rect(0, 72 - 0, 873) or=1
2019-05-21 17:21:53.338 13555-13555/com.pripun.ecom D/ViewRootImpl@50aa60a[Transaction]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=true 547475845120} changed=false
2019-05-21 17:21:53.352 13555-13555/com.pripun.ecom D/ViewRootImpl@4503997[AutocompleteActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=true 547448614912} changed=false

我在Google Place上尝试了此最新代码,但地图不仅显示为空白,但自动填充正在起作用。链接

请注意,截至2019年1月29日,采摘地点已弃用。此功能将于2019年7月29日关闭,该日期之后将不再可用。请注意,使用iOS/Android的旧用户是唯一在折旧期间仍然可以使用该位置选择器的人。现在,两个平台的SDK使用位置都可以通过启用Place API,并且不再支持使用Place Packer的使用。您可能会在https://developers.google.com/places/android-sdk/placepicker中看到折旧通知。

除此之外,Google还对驱动用户使用该地点选择器的内容进行了审查,如果您有兴趣,请在本期(android(issuetracker.google.google.com/128304810中添加答案。,(ios(issuetracker.google.com/128304760。

最新更新