Error inflating class fragment

后端 未结 30 2190
长发绾君心
长发绾君心 2020-11-22 14:38

I get the Error

Unable to start activity ComponentInfo{de.androidbuch.activiti/de.androidbuch.activiti.task.Activity}: android.view.InflateException: Binar         


        
相关标签:
30条回答
  • 2020-11-22 14:50

    I had the same error. I was digging all day long, dunno but i think i tried ~25 solutions on this problem. None worked until at 2AM i found out that i was missing this line at apps manifest xml:

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

    That line was inside <application> tag. I realy hope this helps for someone. GL.

    0 讨论(0)
  • 2020-11-22 14:51

    Check you class path, this could be the view inflator could not find your class definition as defined in your xml class="de.androidbuch.activiti.task.TaskDetailsFragment" the above path could be wrong.

    0 讨论(0)
  • 2020-11-22 14:52

    make sure that u have used this one

    <meta-data
                android:name="com.google.android.maps.v2.API_KEY"
                android:value="AIzaSyBEwmfL0GaZmdVqdTxxxxxxxx-rVgvY" />
    

    not this..

    <meta-data 
             android:name="com.google.android.gms.version" 
              android:value="AIzaSyBEwmfL0GaZmdVqdTCvxxxxxxx-rVgvY" /> 
    
    0 讨论(0)
  • 2020-11-22 14:53

    After one day struggle i found some scenario check may be you are facing same,

    If everything is woking same as google code then please check manifest file in my case i added geo key and map key that's why exception occurs,

    Note - do not add two keys in manifest file remove map key

    meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="@string/google_maps_key"/>
    

    above code and add this code.

     <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/auto_location"/>
    
     <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"/>
    
    0 讨论(0)
  • 2020-11-22 14:54

    If you are adding Fragment statically that is, in xml, then you might have missed to implement OnFragmentInteractionListener in your Activity class. Then the interface implementation would solve the problem. If you are adding Fragment dynamically, that is, in java class then this is not the solution. Because IDE itself will not allow you to proceed without implementing required interfaces.

    0 讨论(0)
  • 2020-11-22 14:55

    I was having the same problem as you are facing. None of the tips on top helped me. Later, I found that all I had to do is fix my imports from:

    import android.app.Fragment;
    

    to:

    import android.support.v4.app.Fragment;
    
    0 讨论(0)
提交回复
热议问题