I have written some code in Android for my first learning application. When I run the app for testing from the android studio while compiling I get this error can anyone help me out with this problem?
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.firstapp.myapp, PID: 29586
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.firstapp.myapp/com.firstapp.myapp.HomeActivity}: java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageView cannot be cast to android.widget.RelativeLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3763)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3931)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2356)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:264)
at android.app.ActivityThread.main(ActivityThread.java:8315)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
Caused by: java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageView cannot be cast to android.widget.RelativeLayout
at com.firstapp.myapp.HomeActivity.init(HomeActivity.java:69)
at com.firstapp.myapp.HomeActivity.onCreate(HomeActivity.java:33)
at android.app.Activity.performCreate(Activity.java:8151)
at android.app.Activity.performCreate(Activity.java:8135)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3732)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3931)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2356)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:264)
at android.app.ActivityThread.main(ActivityThread.java:8315)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
I/Process: Sending signal. PID: 29586 SIG: 9
I have figured out that only this code is generating this error if i remove this code and then run the application it works fine. (e.g. other activites)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:orientation="vertical"
android:background="#color/mainBg"
tools:context=".HomeActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="#color/primaryDark">
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="#drawable/rounded_header_bg"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-40dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- Card item row -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="120dp"
android:layout_weight="1"
android:layout_margin="20dp"
app:cardElevation="0dp"
app:cardCornerRadius="#dimen/_8sdp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white"
android:padding="10dp"
android:id="#+id/galBtn">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="#drawable/gallery"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="#string/gallery"
android:textColor="#color/home_btn_txt"
android:textSize="#dimen/_13sdp"
android:textStyle="bold" />
<ImageView
android:layout_width="#dimen/_12sdp"
android:layout_height="#dimen/_12sdp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="#dimen/_5sdp"
android:src="#drawable/right_arrow"
app:tint="#color/home_right_arrow_color"/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
Related
I'm trying to start this fragment but I'm taking the error below. From what I read, this seems to have a possible large image, but I didn't identify it, after all in this part it calls maps. If anyone has experienced this error, I am grateful for the contribution!`
2021-06-14 12:42:10.327 26833-26833/com.helpcars.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.helpcars.app, PID: 26833
android.view.InflateException: Binary XML file line #133: Binary XML file line #133: Error inflating class <unknown>
Caused by: android.view.InflateException: Binary XML file line #133: Error inflating class <unknown>
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at com.helpcars.app.Fragments.HomeFragment.onCreateView(HomeFragment.java:308)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.content.res.Resources$NotFoundException: Drawable android:color/primary_text_dark with resource ID #0x1060001
Caused by: android.content.res.Resources$NotFoundException: File res/color/primary_text_dark.xml from drawable resource ID #0x1060001
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:847)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:631)
at android.content.res.Resources.loadDrawable(Resources.java:897)
at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:955)
at android.content.res.TypedArray.getDrawable(TypedArray.java:930)
at android.view.View.<init>(View.java:5010)
at android.view.ViewGroup.<init>(ViewGroup.java:659)
at android.widget.LinearLayout.<init>(LinearLayout.java:244)
at android.widget.LinearLayout.<init>(LinearLayout.java:240)
at android.widget.LinearLayout.<init>(LinearLayout.java:236)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
2021-06-14 12:42:10.331 26833-26833/com.helpcars.app E/AndroidRuntime: at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at com.helpcars.app.Fragments.HomeFragment.onCreateView(HomeFragment.java:308)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
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.inflateChildElements(StateListDrawable.java:190)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:122)
at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1332)
at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1291)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:833)
... 42 more
This is the XML of the layout I'm trying to "Inflate".
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Map frame -->
<LinearLayout
android:id="#+id/mapLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/provider_map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!--Project Flow-->
<!--Request to providers-->
<LinearLayout
android:id="#+id/lnrRequestProviders"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#android:color/white"
android:orientation="vertical"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rcvServiceTypes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_5sdp"
android:layout_marginTop="#dimen/_5sdp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/view_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/_10sdp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="#+id/imgPaymentType"
android:layout_width="#dimen/_20sdp"
android:layout_height="#dimen/_20sdp"
app:srcCompat="#drawable/money1" />
<com.helpcars.app.Utils.MyBoldTextView
android:id="#+id/lblPaymentType"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/selected_payment_mode"
android:textColor="#android:color/black"
android:textSize="16sp" />
<com.helpcars.app.Utils.MyBoldTextView
android:id="#+id/lblPaymentChange"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="#string/change"
android:textColor="#android:color/holo_blue_dark"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<com.helpcars.app.Utils.MyButton
android:id="#+id/btnRequestRides"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_20sdp"
android:layout_marginRight="#dimen/_20sdp"
android:layout_marginTop="#dimen/_10sdp"
android:background="#drawable/rounded_button"
android:text="#string/estimate"
android:textColor="#color/button_text_color" />
</LinearLayout>
<!-- Provider popup Layout-->
<LinearLayout
android:id="#+id/lnrProviderPopup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical"
android:visibility="gone">
<LinearLayout
android:id="#+id/lnrHidePopup"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/transparent_black"
android:orientation="vertical"
android:visibility="gone">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#android:color/primary_text_dark"
android:gravity="center"
android:orientation="vertical"
android:padding="#dimen/_10sdp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/imgProviderPopup"
android:layout_width="#dimen/_60sdp"
android:layout_height="#dimen/_60sdp"
android:layout_marginTop="#dimen/_5sdp"
android:src="#drawable/pickup_drop_icon" />
<com.helpcars.app.Utils.MyBoldTextView
android:id="#+id/lblServiceName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_10sdp"
android:gravity="center"
android:maxLines="1"
android:text=""
android:textColor="#color/text_color_black"
android:textSize="#dimen/_14sdp" />
<com.helpcars.app.Utils.MyBoldTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_5sdp"
android:gravity="center"
android:maxLines="1"
android:text="Aguarde o reboque em um local seguro"
android:textColor="#color/text_color_black"
android:textSize="#dimen/_14sdp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginTop="#dimen/_10sdp"
android:background="#android:color/primary_text_dark"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:id="#+id/lnrPriceBase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.helpcars.app.Utils.MyBoldTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="start"
android:maxLines="1"
android:text="Base Price"
android:textColor="#color/black_text_color"
android:textSize="#dimen/_12sdp" />
<com.helpcars.app.Utils.MyBoldTextView
android:id="#+id/lblBasePricePopup"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="end"
android:maxLines="1"
android:text=""
android:textColor="#color/black_text_color"
android:textSize="#dimen/_12sdp" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnrPricekm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp"
android:orientation="horizontal">
<com.helpcars.app.Utils.MyBoldTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="start|center"
android:maxLines="1"
android:text="Price/km"
android:textColor="#color/black_text_color"
android:textSize="#dimen/_12sdp" />
<com.helpcars.app.Utils.MyBoldTextView
android:id="#+id/lblPriceKm"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="end"
android:maxLines="1"
android:text=""
android:textColor="#color/black_text_color"
android:textSize="#dimen/_12sdp" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnrPricemin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp"
android:orientation="horizontal">
<com.helpcars.app.Utils.MyBoldTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="start|center"
android:maxLines="1"
android:text="Price/min"
android:textColor="#color/black_text_color"
android:textSize="#dimen/_12sdp" />
<com.helpcars.app.Utils.MyBoldTextView
android:id="#+id/lblPriceMin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="end"
android:maxLines="1"
android:text=""
android:textColor="#color/black_text_color"
android:textSize="#dimen/_12sdp" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnrCalculationType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp"
android:orientation="horizontal">
<com.helpcars.app.Utils.MyBoldTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="start|center"
android:maxLines="1"
android:text="- É obrigatório o acompanhamento do responsável"
android:textColor="#color/black_text_color"
android:textSize="#dimen/_12sdp" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnrCapacity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp"
android:orientation="horizontal">
<com.helpcars.app.Utils.MyBoldTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="start|center"
android:maxLines="1"
android:text="- Para remoção, somente veículos descarregados"
android:textColor="#color/black_text_color"
android:textSize="#dimen/_12sdp" />
<com.helpcars.app.Utils.MyBoldTextView
android:id="#+id/lblCapacity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="end"
android:maxLines="1"
android:text=""
android:textColor="#color/black_text_color"
android:textSize="#dimen/_12sdp" />
</LinearLayout>
</LinearLayout>
<com.helpcars.app.Utils.MyBoldTextView
android:id="#+id/lblProviderDesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_15sdp"
android:layout_weight="1"
android:lineSpacingMultiplier="1.3"
android:text="The fare will be the price presented upon booking, or, if the journey changes, the fare will be based on the rates provided. Tap fare for details."
android:textSize="#dimen/_10sdp" />
</LinearLayout>
HomeFragment
#Override
public View onCreateView(LayoutInflater inflater, final ViewGroup container,
Bundle savedInstanceState) {
if (rootView == null) {
rootView = inflater.inflate(R.layout.fragment_home, container, false);
}
new Handler().postDelayed(new Runnable() {
#Override
public void run() {
init(rootView);
//permission to access location
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// Android M Permission check
requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
} else {
initMap();
MapsInitializer.initialize(getActivity());
}
}
}, 500);
return rootView;
}
The detail is that it works for various devices and android versions, but specifically for the Moto G Android Pie I get this error.
The error is on the XML file line #133, but I couldn't understand why the LinearLayout starts there.
Possible solution based on the provided source code:
Check if you have used android:src instead of app:srcCompat to assign vector assets. Is #drawable/pickup_drop_icon a vector asset? If yes, you should NOT use android:src.
You forgot to place the trailing </LinearLayout> of the parent.
Add </LinearLayout> to the bottom of your code.
Try code folding the XML file, you will notice that it is missing a </LinearLayout> at the end.
when the compiler gives a generic error message Binary XML file line #133: Error inflating class, I recommend that you first identify if there are any errors in the XML file.
Let me know if you have any questions.
I'm seeing the following exception in crash logs:
android.app.RemoteServiceException: Bad notification posted from package XXX: Couldn't inflate contentViewsandroid.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class com.google.android.material.appbar.AppBarLayout
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1797)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
But, my custom notification layout has never defined this class label:com.google.android.material.appbar.AppBarLayout
Moreover, my custom layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/local_push_bg_color"
android:orientation="vertical"
android:padding="#dimen/dp_6">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/dp_26">
<TextView
android:id="#+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:drawableStart="#drawable/ic_local_push_logo"
android:drawablePadding="#dimen/dp_6"
android:maxLines="1"
android:textStyle="bold"
android:textColor="#color/local_push_title_text_color"
android:text="#string/local_push_title"
android:textSize="#dimen/sp_14"
tools:ignore="RelativeOverlap" />
<ImageView
android:id="#+id/iv_next"
android:layout_width="#dimen/dp_26"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="#drawable/ic_local_push_next"
tools:ignore="ContentDescription" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/v_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="#dimen/dp_10"
android:layout_weight="1">
<ImageView
android:id="#+id/iv_push_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
tools:ignore="ContentDescription" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/shape_bg_local_push_content" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="#drawable/ic_local_push_play" />
<TextView
android:id="#+id/tv_push_content_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="#dimen/dp_10"
android:ellipsize="end"
android:textStyle="bold"
android:maxLines="2"
tools:text="asdaksjdllasfjasldjkasfljkaslkfjlsjafsafjk"
android:textColor="#color/c_white"
android:textSize="#dimen/sp_14" />
</RelativeLayout>
<LinearLayout
android:id="#+id/v_search_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/dp_10"
android:background="#drawable/shape_bg_local_push_search"
android:orientation="horizontal"
android:padding="#dimen/dp_8">
<TextView
android:id="#+id/tv_push_search_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:drawableStart="#drawable/ic_local_push_search"
android:drawablePadding="#dimen/dp_6"
android:ellipsize="end"
android:maxLines="1"
tools:text="what the fk"
android:textColor="#color/local_push_search_text_color"
android:textSize="#dimen/sp_12" />
</LinearLayout>
</LinearLayout>
as you see, There is no class label reported above.
So far, we have found three different error messages for the same
custom notification layout:
Error inflating class com.google.android.material.appbar.AppBarLayout
Error inflating class android.support.design.widget.AppBarLayout
Error inflating class android.widget.TextView
First of all, I know that Material Components 1.1.0 is still in alpha and I am aware, that it can be unstable, but I am interested in some solution. It still could be some problem in my code.
I am creating Alert Dialog with custom view and it is just crashing with such logs. It is working perfectly on some devices and just crashing on other.
android.content.res.Resources$NotFoundException: File res/drawable-v21/abc_dialog_material_background.xml from color state list resource ID #0x7f080019
at android.content.res.Resources.loadColorStateListForCookie(Resources.java:2750)
at android.content.res.Resources.loadColorStateList(Resources.java:2699)
at android.content.res.TypedArray.getColor(TypedArray.java:439)
at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:3780)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:3981)
at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:1969)
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:699)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:641)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:535)
at androidx.appcompat.app.AppCompatDialog.setContentView(AppCompatDialog.java:95)
at androidx.appcompat.app.AlertController.installContent(AlertController.java:232)
at androidx.appcompat.app.AlertDialog.onCreate(AlertDialog.java:279)
at android.app.Dialog.dispatchOnCreate(Dialog.java:394)
at android.app.Dialog.show(Dialog.java:295)
at com.itemstudio.castro.services.dialogs.DialogsHelper.openScreenTesterSettingsDialog(DialogsHelper.kt:168)
at com.itemstudio.castro.screens.tools.screen_tester_activity.ScreenTesterView$initClickListeners$1.onClick(ScreenTesterView.kt:25)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid color state list tag inset
at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:217)
at android.content.res.ColorStateList.createFromXml(ColorStateList.java:201)
at android.content.res.Resources.loadColorStateListForCookie(Resources.java:2746)
at android.content.res.Resources.loadColorStateList(Resources.java:2699)
at android.content.res.TypedArray.getColor(TypedArray.java:439)
at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:3780)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:3981)
at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:1969)
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:699)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:641)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:535)
at androidx.appcompat.app.AppCompatDialog.setContentView(AppCompatDialog.java:95)
at androidx.appcompat.app.AlertController.installContent(AlertController.java:232)
at androidx.appcompat.app.AlertDialog.onCreate(AlertDialog.java:279)
at android.app.Dialog.dispatchOnCreate(Dialog.java:394)
at android.app.Dialog.show(Dialog.java:295)
at com.itemstudio.castro.services.dialogs.DialogsHelper.openScreenTesterSettingsDialog(DialogsHelper.kt:168)
at com.itemstudio.castro.screens.tools.screen_tester_activity.ScreenTesterView$initClickListeners$1.onClick(ScreenTesterView.kt:25)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Here is my XML.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="24dp"
android:background="?attr/colorBackgroundSecondary"
android:paddingTop="24dp"
android:paddingEnd="24dp"
android:paddingBottom="8dp">
<TextView
android:id="#+id/screenTesterOptionsLayoutTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:fontFamily="sans-serif-medium"
android:text="#string/screen_tester_dialog_title"
android:textColor="?android:attr/textColorPrimary"
android:textSize="20sp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="vertical">
<Switch
android:id="#+id/screenTesterOptionsDifferentColors"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="#string/screen_tester_dialog_different_colors" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:background="?attr/colorDivider" />
<Switch
android:id="#+id/screenTesterOptionsCoordinates"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="#string/screen_tester_dialog_coordinates" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:background="?attr/colorDivider" />
<Switch
android:id="#+id/screenTesterOptionsLines"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="#string/screen_tester_dialog_lines" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:background="?attr/colorDivider" />
<Switch
android:id="#+id/screenTesterOptionsVibration"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="#string/screen_tester_dialog_vibration" />
<View
android:id="#+id/screenTesterOptionsVibrationIntensityDivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:background="?attr/colorDivider" />
<TextView
android:id="#+id/screenTesterOptionsVibrationIntensityTitle"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical"
android:text="#string/screen_tester_dialog_vibration_intensity"
android:textColor="?android:attr/textColorPrimary" />
<RadioGroup
android:id="#+id/screenTesterOptionsVibrationIntensitySelection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
<RadioButton
android:id="#+id/screenTesterOptionsVibrationIntensityLow"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="#string/screen_tester_dialog_vibration_intensity_low"
android:textColor="?android:attr/textColorSecondary" />
<RadioButton
android:id="#+id/screenTesterOptionsVibrationIntensityMedium"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="#string/screen_tester_dialog_vibration_intensity_medium"
android:textColor="?android:attr/textColorSecondary" />
<RadioButton
android:id="#+id/screenTesterOptionsVibrationIntensityHigh"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="#string/screen_tester_dialog_vibration_intensity_high"
android:textColor="?android:attr/textColorSecondary" />
</RadioGroup>
<com.google.android.material.button.MaterialButton
android:id="#+id/screenTesterOptionsLayoutButtonApply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:text="#string/screen_tester_dialog_action_apply"
android:textColor="?attr/colorAccent" />
</LinearLayout>
</ScrollView>
If you think, that it is some bug in framework I will just open issue in Google's issue tracker.
The only solution that i found for now is to supercharge the dialog theme overlay :
<style name="Theme.App" parent="Theme.MaterialComponents.Light.NoActionBar" />
<item name="materialAlertDialogTheme">#style/ThemeOverlay.App.MaterialAlertDialog</item>
</style>
<style name="ThemeOverlay.App.MaterialAlertDialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="android:windowBackground">#color/white</item>
</style>
Im working on an android app and when I test it on devices/emulators with api 21 and lower it crashes and gives me a message in the logs:
09-29 07:32:30.349 6212-6212/org.jazmawy.mahmood.vocabulary
E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.jazmawy.mahmood.vocabulary, PID: 6212
java.lang.RuntimeException: Unable to start activity
ComponentInfo{org.jazmawy.mahmood.vocabulary/org.jazmawy.mahmood.vocabulary.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class ImageView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class ImageView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at
org.jazmawy.mahmood.vocabulary.MainActivity.onCreate(MainActivity.java:52)
if I remove the XML elements the app launches and prompts to MainActivity
and It seems that screen sizes doesn't affect the result to my observation its due to the API but i could be wrong
Here is the XML code
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:ads="http://schemas.android.com/apk/res-auto"
tools:context=".MainActivity">
<ImageView
android:id="#+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/green"
android:contentDescription="#string/app_name" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="4dp"
android:layout_marginTop="16dp"
android:orientation="vertical"
android:weightSum="4"
app:layout_constraintBottom_toTopOf="#+id/mainActivityAdView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="#+id/button11"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#drawable/vocabulary_button"
android:onClick="openUnitActivity" />
<Button
android:id="#+id/button13"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#drawable/collection_button"
android:onClick="collectionOnClick" />
<Button
android:id="#+id/button9"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#drawable/contact_us_button"
android:onClick="contactsUsOnClick" />
<Button
android:id="#+id/button14"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#drawable/aboutus_button"
android:onClick="aboutUsOnClick" />
</LinearLayout>
<com.google.android.gms.ads.AdView
android:id="#+id/mainActivityAdView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
ads:adSize="BANNER"
ads:adUnitId="AD_UNIT_ID"
app:layout_constraintStart_toStartOf="parent" />
</android.support.constraint.ConstraintLayout>
I tried cleaning some unnecessary XML attributes but it doesn't help
What should I try next?
its quite simple paste your image into the drawable and change tha path into app\src\main\res\drawable
Hi i have some error when running my application. I have a java files that calls a xml file to inflate a fragment. However when i run it i have an inflationexception. I have looked around but non of the solution seems to work for me. The code is able to run smoothly on emulators and some real devices but when i try to run it on my S3 the error is shown. I my java and xml files are shown below
LoginFragment.java
package com.example.ray.cdmsv2.Fragments;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.ray.cdmsv2.R;
public class LoginFragment extends Fragment {
#Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup container, Bundle savedInstanceState) {
return layoutInflater.inflate(R.layout.fragment_login,container,false);
}
}
fragment_login.xml
<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:gravity="center_horizontal"
android:orientation="vertical"
tools:context=".Fragments.LoginFragment"
android:background="#color/white">
<LinearLayout
android:id="#+id/email_login_form"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal">
<!-- Logo -->
<TableRow
android:layout_gravity="center">
<!-- Spacer -->
<TextView
android:layout_weight="10"/>
<ImageView
android:id="#+id/imageViewFrontLogo"
android:layout_width="200dp"
android:layout_height="235dp"
android:src="#drawable/logo_simtech"
android:layout_weight="80"/>
<!-- Spacer -->
<TextView
android:layout_weight="10"/>
</TableRow>
</TableLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/prompt_username"
android:inputType="textEmailAddress"
android:maxLines="1"
android:singleLine="true"
android:layout_marginTop="0dp"
android:layout_marginBottom="10dp"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/prompt_password"
android:imeActionId="#+id/login"
android:imeActionLabel="#string/action_login"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"/>
</android.support.design.widget.TextInputLayout>
<TextView
android:id="#+id/forgot_password_link"
style="#style/Blue_Font"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/forgot_password"
android:maxLines="1"
android:singleLine="true"
android:gravity="center"
android:clickable="true"
android:onClick="actionForgotPassword"
android:layout_marginTop="10dp"
android:layout_marginBottom="15dp"/>
<Button
android:id="#+id/sign_in_button"
style="#style/Button_Background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/action_login_short"
android:textStyle="bold"
android:onClick="actionLogin"
android:layout_margin="5dp"/>
</LinearLayout>
My LoginFragment.java is the file that is trying to inflate the fragment_login however when i try to run the code i have the following error shown
03-05 16:14:26.752 21537-21537/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.ray.cdmsv2, PID: 21537
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ray.cdmsv2/com.example.ray.cdmsv2.Activities.MainActivity}: android.view.InflateException: Binary XML file line #53: Error inflating class android.support.design.widget.TextInputLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2702)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2767)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5951)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Caused by: android.view.InflateException: Binary XML file line #53: Error inflating class android.support.design.widget.TextInputLayout
at android.view.LayoutInflater.createView(LayoutInflater.java:640)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:750)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
at com.example.ray.cdmsv2.Fragments.LoginFragment.onCreateView(LoginFragment.java:16)
at android.app.Fragment.performCreateView(Fragment.java:2114)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:904)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1082)
at android.app.BackStackRecord.run(BackStackRecord.java:833)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.app.Activity.performStart(Activity.java:6328)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2767)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
Help will be much appreciated