简体   繁体   中英

Android MapFragment Runtime Error - Could not find class 'maps.j.k'

I'm using a SupportMapFragment with complete success. I'm not having any problems at all.

However I'm getting an error during my app's runtime. I'm running on a Gingerbread Phone and it has the latest GooglePlay. Also note that I'm using SupportMapFragment and the other support classes in order to cater to pre-Honeycomb.

Could not find class 'maps.j.k', referenced from method maps.y.ae.a`

The error occurs as soon as I inflate my view.

inflater.inflate(R.layout.fragment_map, container, false);

My layout file (fragment_map.xml):

<fragment
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:map="http://schemas.android.com/apk/res-auto"
    android:id="@+id/map"
    android:name="com.google.android.gms.maps.SupportMapFragment"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1" />

Stack trace (at the moment of error):

Thread [<1> main] (Suspended)   
<VM does not provide monitor information>   
PhoneLayoutInflater(LayoutInflater).inflate(int, ViewGroup, boolean) line: 322  
MapsFragment.onCreateView(LayoutInflater, ViewGroup, Bundle) line: 90   
MapsFragment(Fragment).performCreateView(LayoutInflater, ViewGroup, Bundle) line: 1460  
FragmentManagerImpl.moveToState(Fragment, int, int, int, boolean) line: 911 
FragmentManagerImpl.moveToState(int, int, int, boolean) line: 1088  
BackStackRecord.run() line: 682 
FragmentManagerImpl.execPendingActions() line: 1444 
FragmentManagerImpl$1.run() line: 429   
FragmentActivity$1(Handler).handleCallback(Message) line: 587   
FragmentActivity$1(Handler).dispatchMessage(Message) line: 92   
Looper.loop() line: 150 
ActivityThread.main(String[]) line: 4277    
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
Method.invoke(Object, Object...) line: 507  
ZygoteInit$MethodAndArgsCaller.run() line: 839  
ZygoteInit.main(String[]) line: 597 
NativeStart.main(String[]) line: not available [native method]

My Fragment class (contains the SupportMapFragment)

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
    Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    View v = inflater.inflate(R.layout.fragment_maps, container, false);
    return v;
}

I have all the required permissions in my manifest as described here .

It's not causing any problems, but I'm curious about what it means. I haven't found any answers

Here's a quick start guide on google maps api V2 using support fragment https://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzw

This might help you for trouble shooting Unable instantiate android.gms.maps.MapFragment

hope these helps. :-)

android:name="com.google.android.gms.maps.SupportMapFragment"

用。。。来代替

class="com.google.android.gms.maps.SupportMapFragment"

If you are overriding SupportMapfragment and creating your own fragment class, why are you using android:name="com.google.android.gms.maps.SupportMapFragment" in your activity xml.

Use com.your.package.your.supportmapfragment instead. You need to use class="com.google.android.gms.maps.SupportMapFragment"

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