I've updated my android app to use androidx support libs, when running locally everything works fine, runnings automatic tests with google also works.
The problems started to happen when users updated in google play that it just keeps crashing. Uninstalling and reinstalling the app solves the problem.
I have also had a hard time reproducing this locally but I have access to a phone that keeps crashing with the updated version from google play.
From what I can tell the problem has to do with inflating a view
2019-03-27 09:58:58.667 1975-1975/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp.android, PID: 1975
android.view.InflateException: Binary XML file line #17: Binary XML file line #1: Error inflating class <unknown>
Caused by: android.view.InflateException: Binary XML file line #1: 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:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:658)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:64)
at com.android.internal.policy.HwPhoneLayoutInflater.onCreateView(HwPhoneLayoutInflater.java:107)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:731)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:799)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:976)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:877)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:877)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:974)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.f.b(AppCompatDelegateImpl.java:469)
at androidx.appcompat.app.c.setContentView(AppCompatActivity.java:141)
at com.myapp.android.ui.main.MainActivity.G(MainActivity.java:1224)
at com.myapp.android.ui.main.MainActivity.a(MainActivity.java:106)
at com.myapp.android.ui.main.MainActivity$2.a(MainActivity.java:291)
at com.myapp.android.ui.main.MainActivity$2.onChanged(MainActivity.java:283)
at androidx.lifecycle.LiveData.b(LiveData.java:113)
at androidx.lifecycle.LiveData.a(LiveData.java:131)
at androidx.lifecycle.LiveData.b(LiveData.java:289)
at androidx.lifecycle.p.b(MutableLiveData.java:33)
at androidx.lifecycle.LiveData$1.run(LiveData.java:91)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7425)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x7f0400b4 a=-1}
at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:996)
at android.content.res.TypedArray.getDrawable(TypedArray.java:980)
at android.view.View.<init>(View.java:4746)
at android.view.ViewGroup.<init>(ViewGroup.java:597)
at android.widget.LinearLayout.<init>(LinearLayout.java:237)
at android.widget.LinearLayout.<init>(LinearLayout.java:233)
at android.widget.LinearLayout.<init>(LinearLayout.java:229)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:658)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:64)
at com.android.internal.policy.HwPhoneLayoutInflater.onCreateView(HwPhoneLayoutInflater.java:107)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:731)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:799)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:976)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:877)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:877)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:974)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.f.b(AppCompatDelegateImpl.java:469)
at androidx.appcompat.app.c.setContentView(AppCompatActivity.java:141)
at com.myapp.android.ui.main.MainActivity.G(MainActivity.java:1224)
at com.myapp.android.ui.main.MainActivity.a(MainActivity.java:106)
at com.myapp.android.ui.main.MainActivity$2.a(MainActivity.java:291)
at com.myapp.android.ui.main.MainActivity$2.onChanged(MainActivity.java:283)
at androidx.lifecycle.LiveData.b(LiveData.java:113)
at androidx.lifecycle.LiveData.a(LiveData.java:131)
at androidx.lifecycle.LiveData.b(LiveData.java:289)
at androidx.lifecycle.p.b(MutableLiveData.java:33)
at androidx.lifecycle.LiveData$1.run(LiveData.java:91)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7425)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
I'm not sure if the lines is correct but the error happens here
private void initMainActivity() {
setContentView(R.layout.activity_main);
I've tried to really go through the app to make sure that we are not referencing any old support libs.
Also have set
android.useAndroidX=true
android.enableJetifier=true
without any result.
Any ideas since we are getting a bit lost here.
This only happens when updating to this version from google play, not when testing the app locally och by doing a clean install, confirmed on several devices and os versions.
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context="com.myapp.android.ui.main.MainActivity">
<include layout="#layout/activity_top_section" />
<FrameLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top"
android:animateLayoutChanges="true"
android:clipToPadding="false"
android:elevation="-1dp"
android:orientation="vertical"
android:paddingBottom="#dimen/bottom_bar_height"
android:visibility="visible"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<include
android:id="#+id/activity_bottom_section"
layout="#layout/activity_bottom_section" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
activity_top_section.xml
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.appbar.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingTop="#dimen/appbar_padding_top"
android:stateListAnimator="#null"
android:theme="#style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="#dimen/toolbar_height"
android:layout_weight="1"
android:gravity="center"
android:minHeight="#dimen/toolbar_height"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="#style/AppTheme.PopupOverlay">
<include
android:id="#+id/activity_top_section_toolbar_search"
layout="#layout/activity_top_section_toolbar_search" />
<FrameLayout
android:id="#+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:layout_scrollFlags="scroll|enterAlways" />
<ImageView
android:id="#+id/toolbar_image"
android:layout_width="#dimen/search_image_view_width"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="#string/image_view_content"
android:src="#drawable/logo_black"
android:visibility="gone" />
<TextView
android:id="#+id/toolbar_title"
style="#style/FontText.Large"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:visibility="gone" />
</androidx.appcompat.widget.Toolbar>
<FrameLayout
android:id="#+id/appbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="0dp"
app:layout_scrollFlags="scroll|enterAlways" />
</com.google.android.material.appbar.AppBarLayout>
activity_bottom_section.xml
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<FrameLayout
android:id="#+id/bottom_navigation_view"
android:layout_width="wrap_content"
android:layout_height="#dimen/bottom_bar_parent_height"
android:layout_gravity="bottom">
<View
android:id="#+id/shadow_view"
android:layout_width="match_parent"
android:layout_height="#dimen/default_margin_extra_large"
android:layout_gravity="top"
android:background="#drawable/shadow" />
<com.aurelhubert.ahbottomnavigation.AHBottomNavigation
android:id="#+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="#dimen/bottom_bar_height"
android:layout_gravity="bottom"
android:background="?attr/colorBgLight"
app:itemIconTint="#drawable/navigation_icon_color"
app:menu="#menu/navigation_menu" />
</FrameLayout>
Related
My app fails to start because of Error inflating class ImageButton, Because of this the phone says "app has stopped" Etc.
I am using firebase test lab to debug the problem
the Errors occur on samsung devices specifically A20, s7 Edge , s7(tested with firebase same problem)
I am new to android and have tried many solutions from google and SO none have worked sofar
Here is the error report on firebase
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.smartpractice.smartpracticesmartapp/com.smartpractice.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #117: Binary XML file line #117: Error inflating class ImageButton
FATAL EXCEPTION: main
Process: com.smartpractice.smartpracticesmartapp, PID: 26921
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.smartpractice.smartpracticesmartapp/com.smartpractice.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #117: Binary XML file line #117: Error inflating class ImageButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.view.InflateException: Binary XML file line #117: Binary XML file line #117: Error inflating class ImageButton
at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.smartpractice.myapplication.MainActivity.onCreate(MainActivity.java:14)
at android.app.Activity.performCreate(Activity.java:6876)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
... 9 more
Caused by: android.view.InflateException: Binary XML file line #117: Error inflating class ImageButton
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:855)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
... 17 more
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f070089
at android.content.res.Resources.getValue(Resources.java:2558)
at androidx.appcompat.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:331)
at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:198)
at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:191)
at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:102)
at androidx.appcompat.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:59)
at androidx.appcompat.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:79)
at androidx.appcompat.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:69)
at androidx.appcompat.app.AppCompatViewInflater.createImageButton(AppCompatViewInflater.java:202)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:122)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:758)
Here is the XML
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="#+id/relativeLayout4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/ic_launcher_background"
tools:context=".MainActivity">
<com.google.android.flexbox.FlexboxLayout
android:id="#+id/flexboxLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.863"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/guideline7">
<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="48dp"
android:fontFamily="#font/nunito"
android:gravity="center_horizontal"
android:text="#string/welcome_to_smartpractice"
android:textSize="24sp"
app:fontFamily="#font/nunito"
app:layout_alignSelf="baseline"
tools:layout_editor_absoluteY="100dp"
tools:targetApi="jelly_bean" />
<TextView
android:id="#+id/textView7"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimaryDark"
android:gravity="center_horizontal|fill_vertical"
android:text="#string/docsharesmart"
android:textColor="#color/ic_launcher_background"
app:layout_alignSelf="flex_end"
tools:layout_editor_absoluteY="16dp" />
</com.google.android.flexbox.FlexboxLayout>
<com.google.android.flexbox.FlexboxLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:alignContent="center"
app:alignItems="stretch"
app:flexDirection="row"
app:flexWrap="nowrap"
app:justifyContent="space_between"
app:layout_constraintBottom_toTopOf="#+id/guideline7"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="#+id/imageView3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="#string/logo1"
app:layout_alignSelf="center"
app:srcCompat="#drawable/smartpractice_logo_02"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="-46dp" />
<ImageButton
android:id="#+id/LoginScreen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#null"
android:contentDescription="#string/loginscreen"
app:layout_alignSelf="center"
app:layout_wrapBefore="false"
app:srcCompat="#drawable/ic_more_vert_black_24dp"
tools:layout_editor_absoluteX="248dp"
tools:layout_editor_absoluteY="134dp" />
</com.google.android.flexbox.FlexboxLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="#+id/flexboxLayout2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/flexboxLayout"
app:layout_constraintVertical_bias="0.146">
Here is line 117 from the error
<ImageButton
android:id="#+id/UploadButton"
android:layout_width="300dp"
android:layout_height="209dp"
android:background="#android:color/transparent"
app:layout_constraintTop_toBottomOf="#+id/flexboxLayout"
app:srcCompat="#drawable/upload_files_upload"
android:contentDescription="#string/todo" />
</com.google.android.flexbox.FlexboxLayout>
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_begin="185dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
It means upload_files_upload is not found in drawble folder, well this can be a case, where your file may present in drawable-24 but not in drawble folder, in that case this problem still arise. The point is your file must be in all drawble folder.
The reason for your error is that the upload_files_upload is not in your drawable folder :
<ImageButton
android:id="#+id/UploadButton"
android:layout_width="300dp"
android:layout_height="209dp"
android:background="#android:color/transparent"
app:layout_constraintTop_toBottomOf="#+id/flexboxLayout"
app:srcCompat="#drawable/upload_files_upload"// this line
android:contentDescription="#string/todo" />
I have solved The Issue I changed app:srcCompat="#drawable/upload_files_upload"// to android:src="#drawable/upload_files_upload"
So the problem was by app:srcCompat I changed it to Android:src and it works fine now
I am getting following error for the line #30 i.e. first line of first EditText in the provided code. This XML is basically associated with an Activity. The error is while binding XML inside activity
setContentView(R.layout.activity_login)
The error is as follows:
Caused by android.view.InflateException: Binary XML file line #30: Binary XML file line #30: Error inflating class EditText
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.pockethcm.greytrix.test.LoginActivity.onCreate(LoginActivity.kt:39)
at android.app.Activity.performCreate(Activity.java:6268)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2370)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2477)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1345)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5468)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:671)
I have tried couple of things explained in other answers but none of them actually helped me. I am not using any drawable resource for that EditText.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
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:background="#drawable/login_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.pockethcm.greytrix.test.LoginActivity"
>
<LinearLayout
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:paddingStart="#dimen/_20sdp"
android:paddingEnd="#dimen/_20sdp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/login_layout">
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/profile_image"
android:layout_width="match_parent"
android:layout_height="96dp"
android:src="#drawable/pocketlogosplash"
app:civ_border_width="2dp"
app:civ_circle_background_color="#color/colorWhite"
app:civ_border_color="#bcbcbc"/>
<EditText
android:layout_width="match_parent"
android:backgroundTint="#color/colorWhite"
android:layout_height="wrap_content"
android:hint="Company Code"
android:textColorHint="#color/colorWhite"
android:layout_marginTop="20dp"
android:drawableStart="#drawable/ic_store_white_24dp"
android:drawablePadding="10dp"
android:textColor="#color/colorWhite"
android:id="#+id/company_code"
android:imeOptions="actionNext"
android:maxLines="1"
android:singleLine="true"/>
<EditText
android:layout_width="match_parent"
android:backgroundTint="#color/colorWhite"
android:layout_height="wrap_content"
android:hint="Employee Code"
android:textColorHint="#color/colorWhite"
android:layout_marginTop="20dp"
android:drawableStart="#drawable/ic_person_black_24dp"
android:drawablePadding="10dp"
android:textColor="#color/colorWhite"
android:id="#+id/employee_code"
android:drawableTint="#color/colorWhite"
android:imeOptions="actionNext"
android:maxLines="1"
android:singleLine="true"/>
</LinearLayout>
</ScrollView>
EditText widget should load normally but the activity is crashing with error above.
Providing additional info:
compileSdkVersion 28
minSdkVersion 21
targetSdkVersion 28
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.31"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
You should set left drawable programmatically if its vector for pre kitkat.
company_code.setCompoundDrawablesWithIntrinsicBounds(AppCompatResources.getDrawable(this,R.drawable.ic_store_white_24dp), null, null, null);```
Which android version you are using, I think you use Vector Drawable in EditText, But Vector Drawable support after KitKat.
I have a problem in using Float ActionButton on some devices, (with android version 6.0.1 ,6.0, 5.1.1)
I have tried many ways but still it’s not working
Ways I have tried:
1) I’m using app:rippleColor="#color/white" (instead of app:rippleColor="#android:color/white")
2) Im using app:backgroundTint="#color/fab1" (instead of android:backgroundTint="#color/fab2")
3) I’m using app:srcCompat="#drawable/you_graphics" (instead of android:src="#drawable/your_graphics")
4) My appcompat and design support library versions are the same :
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
Here is my android tag :
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.mvam"
minSdkVersion 14
targetSdkVersion 25
versionCode 5
versionName "1.7.8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Here is my Error:
enter image description here
*java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mvam/com.mvam.activity.ReportActivity}: android.view.InflateException: Binary XML file line #155: Binary XML file line #155: Error inflating class android.support.design.widget.FloatingActionButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
at android.app.ActivityThread.access$1100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7406)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.view.InflateException: Binary XML file line #155: Binary XML file line #155: Error inflating class android.support.design.widget.FloatingActionButton
at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:292)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.mvam.activity.ReportActivity.onCreate(ReportActivity.java:77)
at android.app.Activity.performCreate(Activity.java:6904)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)*
and this is my xml code :
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
style="#style/forms_main_layout_stl"
android:layoutDirection="rtl"
android:orientation="vertical"
tools:context="com.mvam.activity.UsersActivity">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/gray_light"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/main_appbar"
android:layout_width="match_parent"
android:layout_height="#dimen/coordinate_app_bar_height"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_members"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"></android.support.v7.widget.RecyclerView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/btn_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:backgroundTint="#color/orange_colorPrimary"
app:fabSize="normal"
app:layout_anchor="#+id/main_appbar"
app:layout_anchorGravity="bottom|left"
app:rippleColor="#color/colorAccent"
app:srcCompat="#mipmap/ic_add_white_" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/btn_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/coordinate_app_bar_save_btn_margin_left"
app:backgroundTint="#color/orange_colorPrimary"
app:fabSize="normal"
app:layout_anchor="#+id/main_appbar"
app:layout_anchorGravity="bottom|left"
app:rippleColor="#color/colorAccent"
app:srcCompat="#mipmap/ic_save_white" />
</android.support.design.widget.CoordinatorLayout>
</FrameLayout>
do you have any idea? I'd appreciate any help
After updating the android studio to version 3.1.2 & gradle to version 4.4, I've faced weird problem to show snackbar in an activtiy.
here is the code:
#BindView(R.id.layout_coordinator)
CoordinatorLayout coordinatorLayout;
Snackbar.make(coordinatorLayout,"hello", Snackbar.LENGTH_LONG).show();
my XMl layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/layout_coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Activities.LoginActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="70dp"
android:paddingRight="70dp">
<EditText
android:id="#+id/edtMobileNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/txt_RegisterTitle"
android:layout_marginTop="19dp"
android:gravity="center"
android:hint="#string/enterYourMobilePhone"
android:inputType="number"
android:maxLength="11"
android:maxLines="1" />
<Button
android:id="#+id/btn_Confirm"
android:layout_width="130dp"
android:layout_height="40dp"
android:layout_below="#+id/edtMobileNumber"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:background="#drawable/button_background_green"
android:text="#string/confirm"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
</RelativeLayout>
</ScrollView>
</android.support.design.widget.CoordinatorLayout>
And this is the errro I've got:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.company.myproject/com.company.myproject.Activities.LoginActivity}: android.view.InflateException: <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
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: <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
at android.view.LayoutInflater.inflate(LayoutInflater.java:476)
at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
at android.support.design.widget.Snackbar.make(Snackbar.java:143)
at com.company.myproject.Activities.LoginActivity.onCreate(LoginActivity.java:98)
as you can see, the error is about inflating layout but can't understand the reason:
Caused by: android.view.InflateException: can be used only with a valid ViewGroup root and attachToRoot=true
It must be mentioned that I've used every solution that are suggested :
my support design version is : implementation com.android.support:design:27.1.1'
the activtiy is extend from AppCompatActivity
The AppTheme is Theme.AppCompat.Light.NoActionBar
I've used getWindow().getDecorView().findViewById(R.id.layout_coordinator), but nothing is solved
be glad someone could help me.
Finally, I've found the solution:
There is a MERGE tag in the snackbar layout that cause exception while inflating layout. By commenting the related row, the problem is solved.
I'm very new to android development. I know there are many questions like this in stack overflow. I referred those questions but I didn't get solution yet. Whenever I long press the EditText which is inside of TextInputLayout app getting crash.
Fatal Exception: android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class TextView
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.view.View.inflate(View.java:19805)
at android.widget.Editor.getTextThumbnailBuilder(Editor.java:2112)
at android.widget.Editor.performLongClick(Editor.java:1014)
at android.widget.TextView.performLongClick(TextView.java:9240)
at android.view.View$CheckForLongPress.run(View.java:21142)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by android.view.InflateException: Binary XML file line #20: Error inflating class TextView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.view.View.inflate(View.java:19805)
at android.widget.Editor.getTextThumbnailBuilder(Editor.java:2112)
at android.widget.Editor.performLongClick(Editor.java:1014)
at android.widget.TextView.performLongClick(TextView.java:9240)
at android.view.View$CheckForLongPress.run(View.java:21142)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by java.lang.UnsupportedOperationException: Failed to resolve attribute at index 24: TypedValue{t=0x3/d=0x285 "res/color/primary_text_material_light.xml" a=1 r=0x106010a}
at android.content.res.TypedArray.getColor(TypedArray.java:447)
at android.widget.TextView.<init>(TextView.java:738)
at android.widget.TextView.<init>(TextView.java:671)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:60)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:56)
at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
at android.support.v7.app.AppCompatDelegateImplV7.createView(AppCompatDelegateImplV7.java:972)
at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(AppCompatDelegateImplV7.java:1031)
at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:746)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.view.View.inflate(View.java:19805)
at android.widget.Editor.getTextThumbnailBuilder(Editor.java:2112)
at android.widget.Editor.performLongClick(Editor.java:1014)
at android.widget.TextView.performLongClick(TextView.java:9240)
at android.view.View$CheckForLongPress.run(View.java:21142)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by android.view.InflateException
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:782)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:618)
Caused by java.lang.UnsupportedOperationException
android.content.res.TypedArray.getColor (TypedArray.java:447)
android.widget.TextView.<init> (TextView.java:738)
android.widget.TextView.<init> (TextView.java:671)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:618)
My XML file:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="#+id/sign_in_relative_layout"
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:background="#drawable/sign_in_bg"
class = "com.fitficfitz.android.ui.login.SignInFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="#color/colorPrimary"
android:paddingLeft="#dimen/size_5"
>
<ImageView
android:id="#+id/backButton"
android:layout_width="#dimen/size_20"
android:layout_height="#dimen/size_20"
android:layout_marginLeft="#dimen/size_10"
android:src="#drawable/back_btn"/>
<TextView
android:id="#+id/more_session_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SIGN IN"
android:textStyle="normal"
android:textSize="24sp"
android:textColor="#color/white"
android:paddingLeft="#dimen/size_30"
/>
<include
android:id="#+id/book_toolbar"
layout="#layout/book_session_toolbar"/>
</LinearLayout>
<LinearLayout
android:id="#+id/social_sign_in_linear_layout"
android:layout_width="match_parent"
android:layout_height="#dimen/size_126"
android:orientation="horizontal"
android:layout_marginTop="#dimen/size_50">
<FrameLayout
android:id="#+id/twitter_sign_in"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="#dimen/weight_1"
android:visibility="gone">
<TextView
android:id="#+id/twitter_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="#dimen/size_10"
android:drawableTop="#drawable/twitter"
android:gravity="center"
android:letterSpacing="#dimen/letter_spacing_040"
android:text="#string/login_with_twitter"
android:textColor="#color/white"
android:textSize="#dimen/font_13"
tools:ignore="UnusedAttribute"/>
</FrameLayout>
<View
android:id="#+id/social_divider_view"
android:layout_width="#dimen/size_1"
android:layout_height="#dimen/size_126"
android:alpha="0.2"
android:visibility="gone"
android:background="#color/grey_eff6fc"/>
<FrameLayout
android:id="#+id/facebook_sign_in"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="#dimen/weight_1">
<TextView
android:id="#+id/facebook_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="#dimen/size_10"
android:drawableTop="#drawable/facebook"
android:gravity="center"
android:letterSpacing="#dimen/letter_spacing_040"
android:text="#string/login_in_with_facebook"
android:textColor="#color/white"
android:textSize="#dimen/font_13"
tools:ignore="UnusedAttribute"/>
</FrameLayout>
</LinearLayout>
<View
android:id="#+id/social_horizontal_divider_view"
android:layout_width="match_parent"
android:layout_height="#dimen/size_1"
android:layout_below="#+id/social_sign_in_linear_layout"
android:layout_marginBottom="#dimen/size_50"
android:alpha="0.2"
android:background="#color/grey_eff6fc"/>
<ImageView
android:id="#+id/username_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/social_horizontal_divider_view"
android:layout_marginBottom="#dimen/size_20"
android:layout_marginLeft="#dimen/size_28"
android:layout_marginRight="#dimen/size_28"
android:contentDescription="#null"
android:src="#drawable/username"
android:layout_marginTop="#dimen/size_25"/>
<android.support.design.widget.TextInputLayout
android:theme="#style/TextLabel"
android:id="#+id/input_layout_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="#id/username_image_view"
android:layout_toRightOf="#id/username_image_view"
android:layout_marginTop="#dimen/size_10"
android:layout_below="#+id/social_horizontal_divider_view">
<EditText
android:layout_marginTop="10dp"
android:id="#+id/username_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#null"
android:hint="Email Address"
android:inputType="textEmailAddress"
android:paddingBottom="#dimen/size_16"
android:translationY="10dp"
android:textColor="#color/white"
android:textColorHint="#color/white"
android:textSize="#dimen/font_13"/>
</android.support.design.widget.TextInputLayout>
<View
android:id="#+id/username_base_view"
android:layout_width="wrap_content"
android:layout_height="#dimen/size_1"
android:layout_alignLeft="#id/input_layout_username"
android:layout_alignParentRight="true"
android:layout_below="#id/input_layout_username"
android:alpha="0.2"
android:background="#color/grey_eff6fc"
android:paddingBottom="#dimen/size_10"/>
<ImageView
android:id="#+id/password_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/username_base_view"
android:layout_marginTop="#dimen/size_30"
android:contentDescription="#null"
android:paddingBottom="#dimen/size_20"
android:paddingLeft="#dimen/size_28"
android:paddingRight="#dimen/size_28"
android:src="#drawable/password"
/>
<android.support.design.widget.TextInputLayout
android:theme="#style/TextLabel"
android:id="#+id/input_layout_passwrod"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/username_base_view"
android:layout_toEndOf="#id/password_image_view"
android:layout_marginTop="#dimen/size_10"
android:layout_toRightOf="#id/password_image_view">
<EditText
android:id="#+id/password_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#null"
android:hint="#string/password"
android:inputType="textPassword"
android:paddingBottom="#dimen/size_16"
android:paddingTop="#dimen/size_10"
android:textColor="#color/white"
android:textColorHint="#color/white"
android:textSize="#dimen/font_13"
/>
</android.support.design.widget.TextInputLayout>
<ImageView
android:id="#+id/forgot_password_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#id/username_base_view"
android:layout_marginEnd="#dimen/size_20"
android:layout_marginRight="#dimen/size_20"
android:layout_marginTop="#dimen/size_30"
android:clickable="true"
android:src="#drawable/forgot_password"/>
<View
android:id="#+id/password_base_view"
android:layout_width="wrap_content"
android:layout_height="#dimen/size_1"
android:layout_alignLeft="#id/input_layout_passwrod"
android:layout_alignParentRight="true"
android:layout_below="#id/input_layout_passwrod"
android:alpha="0.2"
android:background="#color/grey_eff6fc"/>
<Button
android:id="#+id/sign_in_button"
style="#style/EndButtonStyle"
android:layout_alignParentBottom="true"
android:layout_marginTop="#dimen/size_32"
android:text="#string/sign_in_button"/>
<LinearLayout
android:id="#+id/sign_up_linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#id/sign_in_button"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="#+id/sign_up_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/sign_up_text"
android:textColor="#color/grey_a8a9ab"
android:textSize="#dimen/font_13"/>
<TextView
android:id="#+id/sign_up_question_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/size_4"
android:clickable="true"
android:text="#string/sign_up_question"
android:textColor="#color/grey_a8a9ab"
android:textSize="#dimen/font_14"/>
</LinearLayout>
<FrameLayout
android:id="#+id/login_progress_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="#dimen/alpha_04"
android:background="#color/black"
android:clickable="true"
android:focusable="true"
android:visibility="gone">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</FrameLayout>
</RelativeLayout>
primary_text_material_light.xml code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:color="#color/primary_text_disabled_material_light"/>
<item android:color="#color/primary_text_default_material_light"/>
</selector>
style/TextLabel code:
<style name="TextLabel" parent="TextAppearance.AppCompat">
<item name="android:textColorHint">#color/white</item>
<item name="colorAccent">#color/white</item>
<item name="colorControlNormal">#color/white</item>
<item name="colorControlActivated">#color/white</item>
</style>
I found the issue after spending some hours. The issue is I have missed to add textColorHighlight in my style for TextInputLayout. So, I changed my theme from
<style name="TextLabel" parent="TextAppearance.AppCompat">
<item name="android:textColorHint">#color/white</item>
<item name="colorAccent">#color/white</item>
<item name="colorControlNormal">#color/white</item>
<item name="colorControlActivated">#color/white</item>
</style>
to
<style name="TextLabel" parent="#android:style/TextAppearance.Widget.TextView">
<item name="android:textColorHint">#color/white</item>
<item name="colorAccent">#color/white</item>
<item name="colorControlNormal">#color/white</item>
<item name="colorControlActivated">#color/white</item>
<item name="android:textColorHighlight">#color/grey_5f6971</item>
<item name="android:textColorLink">#color/white</item>
</style>
Thanks guys who are helping me in comment and answer section.
It just basically means that it was not able to find primary_text_material_light.xml in your resources res/color.xml
Please paste your xml code to get detailed answer.
library android support 7 should add rightly.you should remove and add libray and then clean your project.
#line number 20 android:id="#+id/backButton"..... .
In your java file do this ImageView img = (ImageView)findViewById(R.id.backButton);
you might be typecasting R.id.backButton with some other view type