After successfully running Google map on AVD, another problem occurred in the actual project.
1. Why is an error occurring on a real machine when AVD runs normally on my mobile phone and only the grid does not display the map?
Two hundred degrees later, it may be because of the API key issue. During debug, the applied API key uses Debug. keystore, but after the release, the program runs on the real machine. You need to obtain a new keystore and then apply for an API key again. The problem still cannot be solved.
3. Use the re-applied API key to connect to the Development Mode for debugging and find that the logcat error is Authorization failure, that is, the API key applied for by Debug. keystore is also used for connecting to the real machine during debugging. Okay, so change it back. Re-Debug.
4. The error message of logcat is changed to "failed to load map. cocould not contact Google servers." I used Google to search for the error message this time... Finally, find the cause on the stackoverflow Q & A site. Add the following permissions:
<uses-permissionandroid:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
So far, it took me one night to find out the problem and record it.