Error inflating class fragmentが出る Google Maps API v2のアプリ

5,070 views
Skip to first unread message

石田 岳志

unread,
May 24, 2013, 9:05:55 AM5/24/13
to android-g...@googlegroups.com
石田と申します

Google Maps API v2を使ったアプリを作っているのですが、実行すると以下のようなエラーが出てしまいます。

E/AndroidRuntime( 1396): java.lang.RuntimeException: Unable to start activity ComponentInfo{jp.tnct.overthere/jp.tnct.overthere.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
E/AndroidRuntime( 1396): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment

エラー元のXMLファイルです
<?xml version="1.0" encoding="utf-8"?>
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.SupportMapFragment" />

このサイトを参考にしています。自分では一字一句間違えずに手順をこなしたつもりです。
http://www.adamrocker.com/blog/334/google-maps-android-api-v2.html

エラーを検索してみたりや他のチュートリアルも見てみたのですが、うまくいきません。
何が原因なのでしょうか?

Gecko

unread,
Jun 24, 2013, 3:50:19 AM6/24/13
to android-g...@googlegroups.com

石田さん、初めまして
geckoと申します。

私はAndroidManifest.xmlの誤字でそうなってました。(お恥ずかしい)
<meta-data>のcom.google.android.maps.v2.API_KEYがcom.google.android.maps.V2.API_KEYになってたりとか・・・
役に立つかどうかわかりませんが、一応報告したいと思います。

2013年5月24日金曜日 22時05分55秒 UTC+9 石田 岳志:

伊藤琢巳

unread,
Nov 20, 2013, 9:29:02 AM11/20/13
to android-g...@googlegroups.com
石田さん、初めまして

伊藤と申します。

みなさん既に解決済みだと思いますが、
今日同じく1日はまってしまいました。

情報共有のため私のはまったポイントを記しておきます。

AndroidManifest.xml にこの記述を忘れていた。

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

以上です



2013年5月24日金曜日 22時05分55秒 UTC+9 石田 岳志:
石田と申します
Reply all
Reply to author
Forward
0 new messages