{"id":7077,"date":"2014-05-19T04:12:29","date_gmt":"2014-05-19T04:12:29","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/19\/another-google-maps-v2-failed-to-inflate-please-duplicate-collection-of-common-programming-errors\/"},"modified":"2014-05-19T04:12:29","modified_gmt":"2014-05-19T04:12:29","slug":"another-google-maps-v2-failed-to-inflate-please-duplicate-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/19\/another-google-maps-v2-failed-to-inflate-please-duplicate-collection-of-common-programming-errors\/","title":{"rendered":"Another Google maps v2 Failed to inflate PLEASE [duplicate]-Collection of common programming errors"},"content":{"rendered":"<p>i know there was a bunch of posts about this but i just can&#8217;t get my google maps to work. I have tried million different ways to get this and i found that the best way is like this:<\/p>\n<p>MainActivity.java<\/p>\n<pre><code>import android.os.Bundle;\nimport android.support.v4.app.FragmentActivity;\nimport android.view.Menu;\n\npublic class MainActivity extends FragmentActivity {\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setContentView(R.layout.activity_main);\n}\n\n@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n    \/\/ Inflate the menu; this adds items to the action bar if it is present.\n    getMenuInflater().inflate(R.menu.activity_main, menu);\n    return true;\n}\n\n}\n<\/code><\/pre>\n<p>activity_main.xml<\/p>\n<pre><code>\n\n    \n\n\n<\/code><\/pre>\n<p>Manifest.xml<\/p>\n<pre><code>\n\n\n    \n\n    \n\n    \n\n    \n    \n    \n    \n    \n\n\n    \n\n    \n        \n            \n                \n\n                \n            \n        \n\n\n                \n\n    \n\n\n<\/code><\/pre>\n<p>But i still get this error that lots of people are getting \ud83d\ude41 And i implemented google-play-services_lib<\/p>\n<pre><code> 05-13 13:18:39.673: E\/ActivityThread(14542): Failed to inflate\n 05-13 13:18:39.673: E\/ActivityThread(14542): android.view.InflateException: Binary XML           file line #7: Error inflating class fragment\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at      android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at      android.view.LayoutInflater.rInflate(LayoutInflater.java:746)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.view.LayoutInflater.inflate(LayoutInflater.java:489)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.view.LayoutInflater.inflate(LayoutInflater.java:396)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.view.LayoutInflater.inflate(LayoutInflater.java:352)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.app.Activity.setContentView(Activity.java:1881)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at in.wptrafficanalyzer.locationgooglemapv2demo.MainActivity.onCreate(MainActivity.java:12)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.app.Activity.performCreate(Activity.java:5122)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1150)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2432)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2530)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.app.ActivityThread.access$600(ActivityThread.java:176)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1385)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.os.Handler.dispatchMessage(Handler.java:107)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.os.Looper.loop(Looper.java:194)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.app.ActivityThread.main(ActivityThread.java:5546)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at java.lang.reflect.Method.invokeNative(Native Method)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at java.lang.reflect.Method.invoke(Method.java:525)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at dalvik.system.NativeStart.main(Native Method)\n 05-13 13:18:39.673: E\/ActivityThread(14542): Caused by:      java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4323000 but found 0.  You must have the following declaration within the  element:     \n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.common.GooglePlayServicesUtil.t(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.maps.internal.q.B(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.maps.internal.q.A(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.maps.SupportMapFragment$b.gW(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.dynamic.a.a(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.dynamic.a.onInflate(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)\n 05-13 13:18:39.673: E\/ActivityThread(14542):   ... 21 more\n 05-13 13:18:39.683: E\/AndroidRuntime(14542): FATAL EXCEPTION: main\n 05-13 13:18:39.683: E\/AndroidRuntime(14542): java.lang.RuntimeException: Unable to start activity      ComponentInfo{in.wptrafficanalyzer.locationgooglemapv2demo\/in.wptrafficanalyzer.locationgooglemapv2demo.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2478)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2530)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.app.ActivityThread.access$600(ActivityThread.java:176)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1385)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.os.Handler.dispatchMessage(Handler.java:107)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.os.Looper.loop(Looper.java:194)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.app.ActivityThread.main(ActivityThread.java:5546)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at java.lang.reflect.Method.invokeNative(Native Method)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at java.lang.reflect.Method.invoke(Method.java:525)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at dalvik.system.NativeStart.main(Native Method)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.view.LayoutInflater.inflate(LayoutInflater.java:489)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.view.LayoutInflater.inflate(LayoutInflater.java:396)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.view.LayoutInflater.inflate(LayoutInflater.java:352)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.app.Activity.setContentView(Activity.java:1881)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at in.wptrafficanalyzer.locationgooglemapv2demo.MainActivity.onCreate(MainActivity.java:12)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.app.Activity.performCreate(Activity.java:5122)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1150)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2432)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   ... 11 more\n 05-13 13:18:39.683: E\/AndroidRuntime(14542): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4323000 but found 0.  You must have the following declaration within the  element:     \n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.common.GooglePlayServicesUtil.t(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.maps.internal.q.B(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.maps.internal.q.A(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.maps.SupportMapFragment$b.gW(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.dynamic.a.a(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.dynamic.a.onInflate(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   at                android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)\n 05-13 13:18:39.683: E\/AndroidRuntime(14542):   ... 21 more\n<\/code><\/pre>\n<p>Please people can someone help me&#8230;i&#8217;m trying to make simple google maps app for more than a month and i ran out of options&#8230; \ud83d\ude41<\/p>\n","protected":false},"excerpt":{"rendered":"<p>i know there was a bunch of posts about this but i just can&#8217;t get my google maps to work. I have tried million different ways to get this and i found that the best way is like this: MainActivity.java import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.Menu; public class MainActivity extends FragmentActivity { @Override protected void [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7077","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7077"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7077\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}