私はしばらくこのアプリケーションに取り組んでいませんでしたが、私に関する限り、最後にチェックしたときは機能していました。そして今、いくつかのEclipseの再インストールなどの後、次のエラーが発生します:
11-05 23:42:12.777: E/AndroidRuntime(18247): FATAL EXCEPTION: main
11-05 23:42:12.777: E/AndroidRuntime(18247): java.lang.RuntimeException: Unable to start activity ComponentInfo{si.dvanadva.evanturist/si.dvanadva.evanturist.MainActivity}: android.view.InflateException: Binary XML file line #96: Error inflating class fragment
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.app.ActivityThread.access$600(ActivityThread.java:141)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.os.Handler.dispatchMessage(Handler.java:99)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.os.Looper.loop(Looper.java:137)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.app.ActivityThread.main(ActivityThread.java:5103)
11-05 23:42:12.777: E/AndroidRuntime(18247): at java.lang.reflect.Method.invokeNative(Native Method)
11-05 23:42:12.777: E/AndroidRuntime(18247): at java.lang.reflect.Method.invoke(Method.java:525)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-05 23:42:12.777: E/AndroidRuntime(18247): at dalvik.system.NativeStart.main(Native Method)
11-05 23:42:12.777: E/AndroidRuntime(18247): Caused by: android.view.InflateException: Binary XML file line #96: Error inflating class fragment
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.app.Activity.setContentView(Activity.java:1895)
11-05 23:42:12.777: E/AndroidRuntime(18247): at si.dvanadva.evanturist.MainActivity.onCreate(MainActivity.java:258)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.app.Activity.performCreate(Activity.java:5133)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
11-05 23:42:12.777: E/AndroidRuntime(18247): ... 11 more
11-05 23:42:12.777: E/AndroidRuntime(18247): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.maps.internal.q.v(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.maps.internal.q.u(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.maps.SupportMapFragment$b.cE(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.dynamic.a.a(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
11-05 23:42:12.777: E/AndroidRuntime(18247): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
11-05 23:42:12.777: E/AndroidRuntime(18247): ... 22 more
これをマニフェスト ファイルに追加する必要があることがわかりました。
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
しかし、なぜ?これまでマニフェストにこれを入れたことはなく、アプリはうまく機能しました。
2 つ目の問題は、これをマニフェスト ファイルに入れても、アプリは引き続きクラッシュしますが、別の種類の logcat ファイルを取得することです。
11-05 23:51:25.144: E/AndroidRuntime(19384): FATAL EXCEPTION: main
11-05 23:51:25.144: E/AndroidRuntime(19384): java.lang.NullPointerException
11-05 23:51:25.144: E/AndroidRuntime(19384): at si.dvanadva.evanturist.MainActivity.setMarkers(MainActivity.java:443)
11-05 23:51:25.144: E/AndroidRuntime(19384): at si.dvanadva.evanturist.MainActivity.onItemSelected(MainActivity.java:542)
11-05 23:51:25.144: E/AndroidRuntime(19384): at android.widget.AdapterView.fireOnSelected(AdapterView.java:892)
11-05 23:51:25.144: E/AndroidRuntime(19384): at android.widget.AdapterView.access$200(AdapterView.java:49)
11-05 23:51:25.144: E/AndroidRuntime(19384): at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:860)
11-05 23:51:25.144: E/AndroidRuntime(19384): at android.os.Handler.handleCallback(Handler.java:730)
11-05 23:51:25.144: E/AndroidRuntime(19384): at android.os.Handler.dispatchMessage(Handler.java:92)
11-05 23:51:25.144: E/AndroidRuntime(19384): at android.os.Looper.loop(Looper.java:137)
11-05 23:51:25.144: E/AndroidRuntime(19384): at android.app.ActivityThread.main(ActivityThread.java:5103)
11-05 23:51:25.144: E/AndroidRuntime(19384): at java.lang.reflect.Method.invokeNative(Native Method)
11-05 23:51:25.144: E/AndroidRuntime(19384): at java.lang.reflect.Method.invoke(Method.java:525)
11-05 23:51:25.144: E/AndroidRuntime(19384): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
11-05 23:51:25.144: E/AndroidRuntime(19384): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-05 23:51:25.144: E/AndroidRuntime(19384): at dalvik.system.NativeStart.main(Native Method)