android - 我的应用程序显示空白 map

标签 android google-maps google-cloud-platform google-maps-android-api-2

我在我的应用程序中使用谷歌地图 api。 map 工作正常,但现在它变成空白。 map 仍在工作,但未加载 map 。我搜索了几个小时的答案,但没有得到任何结果。我有在谷歌云平台创建了一个新的 api 并放置了该 api 但仍然没有加载 map 。 任何人都可以帮助我解决这个问题。谢谢!

这是空白 map 的屏幕截图。 Screenshot of map

07-21 21:28:59.573 18146-18265/com.example.har.firebaseauthenticationdemo E/Google Maps Android API: Authorization failure.  Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
07-21 21:28:59.575 18146-18265/com.example.har.firebaseauthenticationdemo E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
                                                                                                     Ensure that the "Google Maps Android API v2" is enabled.
                                                                                                     Ensure that the following Android Key exists:
                                                                                                        API Key: AIzaSyDWCP4m0DF57jZU4V8Yr7RFP2-DmhpgL34
                                                                                                        Android Application (<cert_fingerprint>;<package_name>): 0E:0E:68:77:05:BB:76:A3:5C:BC:62:F8:6A:AB:A5:5F:2A:7F:37:5F;com.example.har.firebaseauthenticationdemo
07-21 21:29:00.571 2256-2451/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:-895295850>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/login_manager
                                       fkq: Long live credential not available.
                                           at fkr.b(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="64555651565d5456502455564a514a565d" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):20)
                                           at fkr.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f4c5c6c1c6cdc4c6c0b4c5c6dac1dac6cd" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):50)
                                           at fjb.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1d2c2f282f242d2f295d2c2f3328332f24" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):35)
                                           at gzf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="64555651565d5456502455564a514a565d" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):8)
                                           at gzf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2110131413181113156110130f140f1318" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):160)
                                           at gyf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3001020502090002047001021e051e0209" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):2)
                                           at gyc.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="26171413141f161412661714081308141f" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):17)
                                           at gyc.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="42737077707b7270760273706c776c707b" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):6)
                                           at cug.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="06373433343f363432463734283328343f" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):25)
                                           at cug.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="14252621262d2426205425263a213a262d" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):79)
                                           at cug.onTransact(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="59686b6c6b60696b6d19686b776c776b60" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):8)
                                           at android.os.Binder.transact(Binder.java:627)
                                           at cwl.onTransact(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3d0c0f080f040d0f097d0c0f1308130f04" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):3)
                                           at android.os.Binder.execTransact(Binder.java:697)
07-21 21:29:00.611 2256-3646/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:-895295850>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/login_manager
                                       fkq: Long live credential not available.
                                           at fkr.b(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b2838087808b828086f283809c879c808b" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):20)
                                           at fkr.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f5e5d5a5d565f5d5b2f5e5d415a415d56" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):50)
                                           at fjb.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f1c0c3c4c3c8c1c3c5b1c0c3dfc4dfc3c8" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):35)
                                           at gzf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="74454641464d4446403445465a415a464d" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):8)
                                           at gzf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5e6f6c6b6c676e6c6a1e6f6c706b706c67" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):160)
                                           at gyf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6a5b585f58535a585e2a5b58445f445853" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):2)
                                           at gyc.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="47767572757e777573077675697269757e" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):17)
                                           at gyc.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d4e5e6e1e6ede4e6e094e5e6fae1fae6ed" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):6)
                                           at cug.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="18292a2d2a21282a2c58292a362d362a21" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):25)
                                           at cug.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f2c3c0c7c0cbc2c0c6b2c3c0dcc7dcc0cb" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):79)
                                           at cug.onTransact(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="24151611161d1416106415160a110a161d" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):8)
                                           at android.os.Binder.transact(Binder.java:627)
                                           at cwl.onTransact(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a9989b9c9b90999b9de9989b879c879b90" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):3)
                                           at android.os.Binder.execTransact(Binder.java:697)
07-21 21:29:00.673 2256-3646/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:-895295850>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/login_manager
                                       fkq: Long live credential not available.
                                           at fkr.b(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d1e0e3e4e3e8e1e3e591e0e3ffe4ffe3e8" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):20)
                                           at fkr.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="09383b3c3b30393b3d49383b273c273b30" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):50)
                                           at fjb.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d0e1e2e5e2e9e0e2e490e1e2fee5fee2e9" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):35)
                                           at gzf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b9888b8c8b80898b8df9888b978c978b80" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):8)
                                           at gzf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1f2e2d2a2d262f2d2b5f2e2d312a312d26" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):160)
                                           at gyf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b2838087808b828086f283809c879c808b" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):2)
                                           at gyc.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1120232423282123255120233f243f2328" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):17)
                                           at gyc.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="22131017101b1210166213100c170c101b" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):6)
                                           at cug.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="92a3a0a7a0aba2a0a6d2a3a0bca7bca0ab" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):25)
                                           at cug.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="75444740474c4547413544475b405b474c" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):79)
                                           at cug.onTransact(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4071727572797072740071726e756e7279" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):8)
                                           at android.os.Binder.transact(Binder.java:627)
                                           at cwl.onTransact(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b2838087808b828086f283809c879c808b" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):3)
                                           at android.os.Binder.execTransact(Binder.java:697)
07-21 21:29:00.748 2426-18282/? E/ChromeSync: [Sync,SyncAdapter] Failed to sync.
                                              mbz: fgj: BadAuthentication
                                                  at mfy.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aa9b989f98939a989eea9b98849f849893" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):5)
                                                  at mgm.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2f3f0f7f0fbf2f0f682f3f0ecf7ecf0fb" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):42)
                                                  at mgn.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cbfaf9fef9f2fbf9ff8bfaf9e5fee5f9f2" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):22)
                                                  at mgn.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f1c0c3c4c3c8c1c3c5b1c0c3dfc4dfc3c8" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):73)
                                                  at mgn.b(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="13222126212a2321275322213d263d212a" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):7)
                                                  at mgl.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93a2a1a6a1aaa3a1a7d3a2a1bda6bda1aa" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):41)
                                                  at nrg.onPerformSync(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="19282b2c2b20292b2d59282b372c372b20" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):5)
                                                  at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:321)
                                               Caused by: fgj: BadAuthentication
                                                  at ffx.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f6c7c4c3c4cfc6c4c2b6c7c4d8c3d8c4cf" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):13)
                                                  at ffw.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="23121116111a1311176312110d160d111a" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):2)
                                                  at ffw.e(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="55646760676c6567611564677b607b676c" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):6)
                                                  at ffw.d(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fecfcccbccc7cecccabecfccd0cbd0ccc7" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):1)
                                                  at ffu.b(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="54656661666d6466601465667a617a666d" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):1)
                                                  at nms.b(Unknown Source:6)
                                                  at nlf.b(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6a5b585f58535a585e2a5b58445f445853" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):5)
                                                  at nlw.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="99a8abacaba0a9abadd9a8abb7acb7aba0" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):58)
                                                  at mfy.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f7c6c5c2c5cec7c5c3b7c6c5d9c2d9c5ce" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):1)
                                                  at mgm.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="28191a1d1a11181a1c68191a061d061a11" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):42) 
                                                  at mgn.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cffefdfafdf6fffdfb8ffefde1fae1fdf6" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):22) 
                                                  at mgn.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="07363532353e373533473635293229353e" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):73) 
                                                  at mgn.b(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="72434047404b4240463243405c475c404b" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):7) 
                                                  at mgl.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0c3d3e393e353c3e384c3d3e2239223e35" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):41) 
                                                  at nrg.onPerformSync(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="99a8abacaba0a9abadd9a8abb7acb7aba0" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):5) 
                                                  at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:321) 
07-21 21:29:03.389 1599-1612/? E/memtrack: Couldn't load memtrack module
07-21 21:29:05.559 1599-1612/? E/memtrack: Couldn't load memtrack module
07-21 21:29:05.574 1599-1612/? E/memtrack: Couldn't load memtrack module
07-21 21:29:12.866 2256-18310/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:-895295850>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/experimentsandconfigs
                                        fkq: Long live credential not available.
                                            at fkr.b(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4071727572797072740071726e756e7279" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):20)
                                            at fkr.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cefffcfbfcf7fefcfa8efffce0fbe0fcf7" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):50)
                                            at fjb.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0130333433383133354130332f342f3338" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):35)
                                            at gzf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0c3d3e393e353c3e384c3d3e2239223e35" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):8)
                                            at gzf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b08182858289808284f081829e859e8289" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):160)
                                            at gyf.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4b7a797e79727b797f0b7a79657e657972" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):2)
                                            at gyc.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="06373433343f363432463734283328343f" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):17)
                                            at gyc.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="37060502050e070503770605190219050e" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):6)
                                            at cug.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ffcecdcacdc6cfcdcbbfcecdd1cad1cdc6" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):25)
                                            at cug.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="22131017101b1210166213100c170c101b" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):79)
                                            at ffx.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="97a6a5a2a5aea7a5a3d7a6a5b9a2b9a5ae" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):6)
                                            at ffw.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3828186818a838187f382819d869d818a" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):2)
                                            at ffw.e(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="57666562656e676563176665796279656e" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):6)
                                            at ffu.f(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="33020106010a0301077302011d061d010a" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):3)
                                            at ffu.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="98a9aaadaaa1a8aaacd8a9aab6adb6aaa1" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):4)
                                            at ffu.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="87b6b5b2b5beb7b5b3c7b6b5a9b2a9b5be" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):7)
                                            at aenk.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bb8a898e89828b898ffb8a89958e958982" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):22)
                                            at aenm.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="55646760676c6567611564677b607b676c" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):130)
                                            at aenm.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c0f1f2f5f2f9f0f2f480f1f2eef5eef2f9" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):243)
                                            at aenm.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c9f8fbfcfbf0f9fbfd89f8fbe7fce7fbf0" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):404)
                                            at com.google.android.gms.phenotype.sync.HeterodyneSyncTaskChimeraService.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7e4f4c4b4c474e4c4a3e4f4c504b504c47" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):66)
                                            at com.google.android.gms.phenotype.sync.HeterodyneSyncTaskChimeraService.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="14252621262d2426205425263a213a262d" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):20)
                                            at ulu.run(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1120232423282123255120233f243f2328" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):1)
                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                            at java.lang.Thread.run(Thread.java:764)
07-21 21:29:12.884 2256-18310/? E/HeterodyneSyncTaskChime: Failed to get auth token: User intervention required. Notification has been pushed. -- metadata{ service_id: 51 }
                                                           fgk: User intervention required. Notification has been pushed.
                                                               at ffu.f(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c1f0f3f4f3f8f1f3f581f0f3eff4eff3f8" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):10)
                                                               at ffu.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a19093949398919395e190938f948f9398" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):4)
                                                               at ffu.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="19282b2c2b20292b2d59282b372c372b20" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):7)
                                                               at aenk.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d6e7e4e3e4efe6e4e296e7e4f8e3f8e4ef" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):22)
                                                               at aenm.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="17262522252e272523572625392239252e" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):130)
                                                               at aenm.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="22131017101b1210166213100c170c101b" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):243)
                                                               at aenm.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2e1f1c1b1c171e1c1a6e1f1c001b001c17" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):404)
                                                               at com.google.android.gms.phenotype.sync.HeterodyneSyncTaskChimeraService.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="29181b1c1b10191b1d69181b071c071b10" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):66)
                                                               at com.google.android.gms.phenotype.sync.HeterodyneSyncTaskChimeraService.a(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f2c3c0c7c0cbc2c0c6b2c3c0dcc7dcc0cb" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):20)
                                                               at ulu.run(:com.google.android.gms@<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0a3b383f38333a383e4a3b38243f243833" rel="noreferrer noopener nofollow">[email protected]</a> (040700-192802242):1)
                                                               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                                               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                                               at java.lang.Thread.run(Thread.java:764)

最佳答案

Ensure that the "Google Maps Android API v2" is enabled.

  • 转到Google Console API 和搜索 Android API map 。并确保其已启用。

Ensure that the following Android Key exists:

  • 转至 Google Console 凭据管理器。并添加用于调试和发布的 android API key 。检查Google Doc了解更多详情。

更新1

  • 来自您的 logcat。

07-21 21:28:59.573 18146-18265/com.example.har.firebaseauthenticationdemo E/Google Maps Android API: Authorization failure.

请参阅https://developers.google.com/maps/documentation/android-api/start了解如何正确设置 map 。

更新2

build.gradle

buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            resValue "string", "google_maps_api_key", "Release_API_KEY"
        }
        debug {
//          KL MBP debug Key
            resValue "string", "google_maps_api_key", "DEBUG_API_KEY"
//          KL Old Machine debug Key
//            resValue "string", "google_maps_api_key", "DEBUG_API_KEY"
        }
    }

AndroidManifest.xml

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="@string/google_maps_api_key"/>

    <uses-library
        android:name="com.google.android.maps"
        android:required="true" />

更新3

获取用于生成 API key 的 SHA1

  • 对于 Linux 或 macOS,请打开终端窗口并输入以下内容:

macOS and Linux: ~/.android/

 keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android 
  • 对于 Windows Vista 和 Windows 7,请运行:

Windows Vista and Windows 7:

C:\Users\your_user_name\.android\列出 SHA-1 指纹:

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

更新4

在 Android Studio 中,您无需任何控制台命令即可找到所有应用签名信息:

  1. 打开您的项目
  2. 点击右侧面板中的 Gradle
  3. 在 Gradle 项目面板中打开文件夹:您的项目 -> 任务 -> Android
  4. 运行签名报告任务(双击),您将在 Gradle 控制台中看到结果( keystore 路径、SHA1、MD5 等)。

关于android - 我的应用程序显示空白 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51457927/

相关文章:

android - 支持的设备 0 显示在 Google Play 开发者控制台上

ios - 在 iOS 版谷歌地图上的自定义标记上添加文本

google-maps - 点击谷歌地图标记时显示模态底部工作表

google-cloud-platform - Google 的 AutoML 能否导出经过训练的模型以进行离线推理?

google-cloud-platform - 通过 gcloud 在数据存储模式下使用 firestore 时创建数据库?

google-cloud-platform - 无法删除 Google Cloud 项目

android - 更改 ImageView 源

Android 运行时 GPS 位置 - 黑莓设备 - 不工作

安卓数据绑定(bind) : conditional formatting to set layout_weight

android - Google map 未显示在 ViewPager 中的选项卡 fragment 上