5

完全に成功した SupportMapFragment を使用しています。まったく問題ありません。

ただし、アプリの実行中にエラーが発生します。私は Gingerbread Phone を使用しており、最新の GooglePlay がインストールされています。また、Pre-Honeycomb に対応するために、SupportMapFragment とその他のサポート クラスを使用していることにも注意してください。

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

ビューを膨らませるとすぐにエラーが発生します。

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

私のレイアウトファイル(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" />

スタック トレース (エラーの瞬間):

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]

私の Fragment クラス (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;
}

here で説明されているように、マニフェストに必要なすべての権限があります。

問題はありませんが、どういう意味なのか気になります。答えが見つからない

4

3 に答える 3

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

と置換する

class="com.google.android.gms.maps.SupportMapFragment"
于 2013-02-25T12:44:54.790 に答える
0

独自のフラグメント クラスをオーバーライドSupportMapfragmentして作成している場合、なぜandroid:name="com.google.android.gms.maps.SupportMapFragment"アクティビティ xml で使用しているのですか。

代わりに com.your.package.your.supportmapfragment を使用してください。使用する必要がありますclass="com.google.android.gms.maps.SupportMapFragment"

于 2013-06-15T01:26:27.717 に答える
0

サポート フラグメントhttps://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzwを使用した Google Maps API V2 のクイック スタート ガイドを次に示します。

これは、 android.gms.maps.MapFragment をインスタンス化できないトラブルシューティングに役立つ場合があります

これらが役立つことを願っています。:-)

于 2013-02-22T00:21:17.873 に答える