我正在嘗試使用Android Studio執行MapActivity。它必須顯示用戶的位置。ANDROID:錯誤W/DynamiteModule:未找到com.google.android.gms.google證書的本地模塊描述符類
嗯,我知道我需要一個密鑰才能使用這個API,並相信我,我至少改了四次這個密鑰......我也擁有AndroidManifest.xml中的權限。
事情是我可以在沒有用戶位置的情況下顯示地圖,但是如果我嘗試顯示他/她的位置,那麼應用程序編譯得很好,但是當我嘗試執行它時,它會停止並且我獲得此錯誤:
11-12 09:13:28.416 21576-21653/raquel.mapapplication W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
11-12 09:13:28.424 21576-21653/raquel.mapapplication I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:2
11-12 09:13:28.424 21576-21653/raquel.mapapplication I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 2
11-12 09:13:28.432 21576-21653/raquel.mapapplication W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/0000000b/n/armeabi
11-12 09:13:28.436 21576-21653/raquel.mapapplication D/GoogleCertificates: com.google.android.gms.googlecertificates module is loaded
11-12 09:13:28.504 21576-21653/raquel.mapapplication D/GoogleCertificatesImpl: Fetched 190 Google release certificates
11-12 09:13:28.505 21576-21653/raquel.mapapplication D/GoogleCertificatesImpl: Fetched 363 Google certificates
11-12 09:13:31.235 21576-21576/raquel.mapapplication I/Process: Sending signal. PID: 21576 SIG: 9
它提到一些關於谷歌證書,這就是爲什麼我想,也許它是與關鍵...但我不知道,我沒有想法是什麼,我做錯了。
謝謝你的幫助。
////////
好吧,我會嘗試張貼一些代碼...我一直在改變代碼所有的時間,但是這是我最後一次嘗試(我也試過setMyLocationEnable (真),因爲getMyLocation()已過時,但我得到了同樣的錯誤):
公共類MapsActivity擴展FragmentActivity實現OnMapReadyCallback {
private GoogleMap mMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
Location location=mMap.getMyLocation();
double lat=location.getLatitude();
double lon=location.getLongitude();
// Add a marker in Sydney and move the camera
LatLng sydney = new LatLng(lat, lon);
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
}
感謝回答我的人和編輯我評論的人...我仍然不太好如何格式化文本...
你可以包括一些代碼,以及好嗎? –
嘗試在Google Developer Console中更新項目中的SHA1密鑰並更新您的Android項目中的Google Maps API密鑰。爲了更好地理解,請確保正確執行本[文檔]中給出的步驟(https://developers.google.com/maps/documentation/android-api/signup#if-you-are-using-the-standard- google-maps-android-api),尤其是[「在哪裏獲取應用程序的SHA-1指紋」]的部分內容(https://developers.google.com/maps/documentation/android-api/signup#fingerprint) – KENdi
嗨拉奎爾,你解決了嗎? (我在這裏有同樣的問題) – MiguelHincapieC