5

Używam SupportMapFragment z pełnym sukcesem. Nie mam żadnych problemów.Błąd Runtime Android MapFragment - Nie można znaleźć klasy "maps.j.k"

Jednak podczas uruchamiania aplikacji występuje błąd. Używam telefonu Gingerbread Phone i mam najnowszą wersję Google Play. Zauważ też, że używam SupportMapFragment i innych klas wsparcia, aby obsłużyć pre-Honeycomb.

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

Błąd pojawia się, gdy nadmucham swój widok.

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

Mój plik układ (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" /> 

Ślad stosu (w momencie wystąpienia błędu):

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] 

Moja klasa Fragment (zawiera 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; 
} 

Mam wszystkie wymagane uprawnienia w moim manifeście, jak opisano here.

Nie powoduje żadnych problemów, ale jestem ciekaw co to znaczy. Nie znalazłem żadnych odpowiedzi

+3

Może to być problem z programem Proguard - możesz ukryć kod. –

+0

Hmm, ale w moim project.properties Mam # proguard.config = ... skomentowane. Czy to nie oznacza, że ​​jest wyłączony? –

+0

Powinno to oznaczać, że jest wyłączony, interesujący problem. –

Odpowiedz

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

zastąpić

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

Nie ma szczęścia, obawiam się. Zauważyłem też, że dzieje się tak tylko przy pierwszym załadowaniu mapy. Jeśli zminimalizujesz aplikację lub zmienisz czynności itp., A następnie wróć do mapy, błąd nie zostanie podniesiony. –

0

Jeśli nadrzędne SupportMapfragment i tworząc własne klasy fragment, dlaczego używasz android:name="com.google.android.gms.maps.SupportMapFragment" w swojej działalności xml.

Zamiast tego użyj com.your.package.your.supportmapfragment. Musisz użyć class="com.google.android.gms.maps.SupportMapFragment"

Powiązane problemy