简体   繁体   中英

Google places autocomplete gives “Cannoat load results !”

I try to implement the google autocomplete feature inside my application and when I try searching it says: "Cannot Load results" and the log says E/Places: Error while autocompleting: NETWORK_ERROR.

I have acquired an api key, added the following permisions:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

And this is how I initialize places (in the google cloud platform the places api is enabled):

    Places.initialize(getApplicationContext(), apiKey);

I have managed to solve the issue by testing manually on my phone and then installing a new emulator. Thank you for your support !

Yes, this is the guideline I used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM