I am using MapView inside a fragment. Now it does not load. (Or to be precise, it loads but it does not load. Yes, its weird, pics attached.)
Some logs on console when map loads (or fails to load/tries to load)
W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:1
I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 1
D/ChimeraFileApk: Primary ABI of requesting process is armeabi-v7a
I/art: DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/data@data@com.google.android.gms@app_chimera@m@00000006@DynamiteModulesA_GmsCore_prodlmp_xxhdpi_release.apk@classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/00000006/DynamiteModulesA_GmsCore_prodlmp_xxhdpi_release.apk': Failed to open oat filename for reading: No such file or directory
D/ChimeraFileApk: Classloading successful. Optimized code found.
D/GoogleCertificates: com.google.android.gms.googlecertificates module is loaded
Fetched 163 Google release certificates
Fetched 318 Google certificates
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
Here is the code :
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_home, container, false);
mapView = (MapView) view.findViewById(R.id.mapview);
// Gets the MapView from the XML layout and creates it
mapView.onCreate(savedInstanceState);
// Gets to GoogleMap from the MapView and does initialization stuff
mapView.getMapAsync(this);
}
And on MapReady, I do this :
@Override
public void onMapReady(GoogleMap googleMap) {
map = googleMap;
map.getUiSettings().setMyLocationButtonEnabled(true);
map.getUiSettings().setAllGesturesEnabled(true);
map.setMyLocationEnabled(true);
// Needs to call MapsInitializer before doing any CameraUpdateFactory calls
try {
MapsInitializer.initialize(this.getActivity());
} catch (Exception e) {
e.printStackTrace();
}
// Updates the location and zoom of the MapView
CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(43.1, -87.9), 10);
map.animateCamera(cameraUpdate);
}
The map is not even loaded. When I keep clicking on it. Then after a few seconds it suddenly starts showing zoomed, but does not respond to any user interaction. Nothing happens whether i click it pinch zoom it. Now when I use a SUPPORT MAP FRAGMENT, it loads immediately and perfectly. So, MY API KEY IS CORRECT AND INTERNET IS PERFECTLY FINE. But MAP VIEW IN THE FRAGMENT DOES NOT WORK.
I also checked this link and the logs are same like I am getting :Here
Sometimes when I keep clicking on it , say 10 20 times, then after few seconds only some part of map is visible. But still no user interaction. Nothing happens, no matter what I do.
Now here are the screenshots of the MapView :
Please help me, can anyone tell me if its a bug on my side or a real bug on Android's mapview. Has anyone able to use MapView inside fragment with latest Google Play services ?
Please help me, I am stuck.
Thanks