java – android. view. Inflateexception: binary XML file line #6: error ballooning class fragemnt
•
Java
This error occurs when the application starts
I received many kinds of errors displayed in subj These mistakes seem to be accidental and I can't reproduce them From the stack, I can see that such errors may occur in my different layout resources The boundaries of XML are also different
Can anyone explain why this mistake happened? What can I do to solve this problem?
09-06 00:15:33.254: E/AndroidRuntime(7812): FATAL EXCEPTION: main 09-06 00:15:33.254: E/AndroidRuntime(7812): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.touchboarder.example.videostream/com.touchboarder.example.videostream.Activity_Mapa}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.app.ActivityThread.access$600(ActivityThread.java:140) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.os.Handler.dispatchMessage(Handler.java:99) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.os.Looper.loop(Looper.java:137) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.app.ActivityThread.main(ActivityThread.java:4898) 09-06 00:15:33.254: E/AndroidRuntime(7812): at java.lang.reflect.Method.invokeNative(Native Method) 09-06 00:15:33.254: E/AndroidRuntime(7812): at java.lang.reflect.Method.invoke(Method.java:511) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773) 09-06 00:15:33.254: E/AndroidRuntime(7812): at dalvik.system.NativeStart.main(Native Method) 09-06 00:15:33.254: E/AndroidRuntime(7812): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:308) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.app.Activity.setContentView(Activity.java:1924) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.touchboarder.example.videostream.Activity_Mapa.onCreate(Activity_Mapa.java:59) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.app.Activity.performCreate(Activity.java:5206) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064) 09-06 00:15:33.254: E/AndroidRuntime(7812): ... 11 more 09-06 00:15:33.254: E/AndroidRuntime(7812): Caused by: java.lang.RuntimeException: API key not found. Check that <Meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml 09-06 00:15:33.254: E/AndroidRuntime(7812): at maps.ag.bb.a(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at maps.ag.bb.a(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at maps.ag.an.a(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at maps.ag.bi.a(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at maps.ag.bh.a(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at blf.onTransact(SourceFile:107) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.os.Binder.transact(Binder.java:326) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.google.android.gms.maps.internal.IMapFragmentDelegate$a$a.onCreateView(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.google.android.gms.maps.SupportMapFragment$a.onCreateView(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.google.android.gms.internal.bh$4.b(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.google.android.gms.internal.bh.a(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.google.android.gms.internal.bh.onCreateView(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at com.google.android.gms.maps.SupportMapFragment.onCreateView(UnkNown Source) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1478) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:900) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1082) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1184) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:285) 09-06 00:15:33.254: E/AndroidRuntime(7812): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
This error occurs when the application starts. I need help
This is the result of XML, but this error occurs in other xmls
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/> </LinearLayout>
mi manifestbut i don't found the mistake <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.touchboarder.example.videostream" android:versionCode="1" android:versionName="1.0"> <Meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyCZG-M6IwXlt46Y37Ip9bp0WdV-shyC39w"/> <uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="com.touchboarder.example.videostream.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-feature android:glEsVersion="0x00020000" android:required="true" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"> <activity android:name=".Activity_Home" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".Activity_Reserva" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden|screenSize"> </activity> <activity android:name=".Activity_Registro" android:screenOrientation="portrait"> </activity> <activity android:name=".Activity_Mapa" > </activity> </application> </manifest>
Solution
<application>
<application> <Meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="youApiKey" /> <Meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> </application>
It's androidmanifest Elements of XML
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码