Fabricio Villela Fabricio Villela - 6 months ago 37
Android Question

Error to inflate layout

I really need help, my code was working but at some point it stopped working. I have no idea what might have happened. I REALLY NEED HELP, I will provide my java class and my layout for download, I hope someone can help me.

Link to download the class and layot
https://drive.google.com/folderview?id=0B68kqIqGRAY8c3k1bTF4STNTdVE&usp=sharing

When calling the screen displays this error:

05-26 20:23:38.528 13783-13783/com.caseb.case_beauty_ E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.caseb.case_beauty_, PID: 13783
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.caseb.case_beauty_/com.caseb.case_beauty_.MapsActivity}: android.view.InflateException: Binary XML file line #64: Error inflating class <unknown> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java)
at android.app.ActivityThread.access$800(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java)
at android.os.Handler.dispatchMessage(Handler.java)
at android.os.Looper.loop(Looper.java)
at android.app.ActivityThread.main(ActivityThread.java)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #64: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java)
at android.view.LayoutInflater.rInflate(LayoutInflater.java)
at android.view.LayoutInflater.rInflate(LayoutInflater.java)
at android.view.LayoutInflater.rInflate(LayoutInflater.java)
at android.view.LayoutInflater.inflate(LayoutInflater.java)
at android.view.LayoutInflater.inflate(LayoutInflater.java)
at android.view.LayoutInflater.inflate(LayoutInflater.java)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.caseb.case_beauty_.MapsActivity.onCreate(MapsActivity.java:56)
at android.app.Activity.performCreate(Activity.java)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java) 
at android.app.ActivityThread.access$800(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java) 
at android.os.Handler.dispatchMessage(Handler.java) 
at android.os.Looper.loop(Looper.java) 
at android.app.ActivityThread.main(ActivityThread.java) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java) 
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java) 
at android.view.LayoutInflater.inflate(LayoutInflater.java) 
at android.view.LayoutInflater.inflate(LayoutInflater.java) 
at android.view.LayoutInflater.inflate(LayoutInflater.java) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at com.caseb.case_beauty_.MapsActivity.onCreate(MapsActivity.java:56) 
at android.app.Activity.performCreate(Activity.java) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java) 
at android.app.ActivityThread.access$800(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java) 
at android.os.Handler.dispatchMessage(Handler.java) 
at android.os.Looper.loop(Looper.java) 
at android.app.ActivityThread.main(ActivityThread.java) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: android.content.res.Resources$NotFoundException: File res/color-v11/abc_background_cache_hint_selector_material_light.xml from drawable resource ID #0x7f0c006c
at android.content.res.Resources.loadDrawable(Resources.java)
at android.content.res.MiuiResources.loadDrawable(MiuiResources.java)
at android.content.res.Resources.loadDrawable(Resources.java)
at android.content.res.TypedArray.getDrawable(TypedArray.java)
at android.view.View.<init>(View.java)
at android.view.ViewGroup.<init>(ViewGroup.java)
at android.widget.FrameLayout.<init>(FrameLayout.java)
at android.widget.FrameLayout.<init>(FrameLayout.java)
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
at android.view.LayoutInflater.createView(LayoutInflater.java) 
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java) 
at android.view.LayoutInflater.inflate(LayoutInflater.java) 
at android.view.LayoutInflater.inflate(LayoutInflater.java) 
at android.view.LayoutInflater.inflate(LayoutInflater.java) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at com.caseb.case_beauty_.MapsActivity.onCreate(MapsActivity.java:56) 
at android.app.Activity.performCreate(Activity.java) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java) 
at android.app.ActivityThread.access$800(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java) 
at android.os.Handler.dispatchMessage(Handler.java) 
at android.os.Looper.loop(Looper.java) 
at android.app.ActivityThread.main(ActivityThread.java) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #18: <item> tag requires a 'drawable' attribute or child tag defining a drawable
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java)
at android.content.res.Resources.createFromXml(Resources.java)
at android.content.res.Resources.loadDrawable(Resources.java) 
at android.content.res.MiuiResources.loadDrawable(MiuiResources.java) 
at android.content.res.Resources.loadDrawable(Resources.java) 
at android.content.res.TypedArray.getDrawable(TypedArray.java) 
at android.view.View.<init>(View.java) 
at android.view.ViewGroup.<init>(ViewGroup.java) 
at android.widget.FrameLayout.<init>(FrameLayout.java) 
at android.widget.FrameLayout.<init>(FrameLayout.java) 
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
at android.view.LayoutInflater.createView(LayoutInflater.java) 
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java) 
at android.view.LayoutInflater.inflate(LayoutInflater.java) 
at android.view.LayoutInflater.inflate(LayoutInflater.java) 
at android.view.LayoutInflater.inflate(LayoutInflater.java) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at com.caseb.case_beauty_.MapsActivity.onCreate(MapsActivity.java:56) 
at android.app.Activity.performCreate(Activity.java) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java) 
at android.app.ActivityThread.access$800(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java) 
at android.os.Handler.dispatchMessage(Handler.java) 
at android.os.Looper.loop(Looper.java) 
at android.app.ActivityThread.main(ActivityThread.java) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) 
at dalvik.system.NativeStart.main(Native Method) 


I think it's a problem with my xml but I can not see.

My xml (available for download)

Please help

Answer

Maybe try

class="com.google.android.gms.maps.SupportMapFragment"

instead of "android:name=" in your activity_maps.xml line #73.

If this doesn't fix it, you probably want to take a look at this

Comments