Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InflateException coming for few android 7.0 devices #27

Closed
hmittal1 opened this issue May 8, 2017 · 18 comments
Closed

InflateException coming for few android 7.0 devices #27

hmittal1 opened this issue May 8, 2017 · 18 comments

Comments

@hmittal1
Copy link

hmittal1 commented May 8, 2017

InflateException is coming for few android device having version 7.0 on eample code
android:layout_marginTop="@dimen/_45ssp".

Stacktrace:

Caused by: android.view.InflateException: Binary XML file line #33: Binary XML file line #33: Error inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #33: Error inflating class TextView
Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 2 to dimension: type=0x1
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:720)
at android.widget.TextView.(TextView.java:1088)
at android.widget.TextView.(TextView.java:704)
at android.support.v7.widget.bm.(Unknown Source)
at android.support.v7.widget.bm.(Unknown Source)

@trinadhkoya
Copy link

You can include ,values folders inside your project instead lib.that might help you

@elhanan-mishraky
Copy link
Contributor

Did you add ssp or only sdp?
To add also ssp, please use:
dependencies {
compile 'com.intuit.ssp:ssp-android:1.0.4'
}

@hmittal1
Copy link
Author

hmittal1 commented May 9, 2017

Yah. I missed the point of separate lib for non text and text views. Thanks !!

@hmittal1 hmittal1 closed this as completed May 9, 2017
@hmittal1
Copy link
Author

hmittal1 commented May 9, 2017

I got one more crash in textview. It is again 7.0 device moto G5 Plus.
Binary XML file line #36: Binary XML file line #36: Error inflating class TextView.
Code:

Already include compile 'com.intuit.ssp:ssp-android:1.0.4' line in code.

@hmittal1 hmittal1 reopened this May 9, 2017
@hmittal1
Copy link
Author

hmittal1 commented May 9, 2017

Code:
TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/app_text_color"
android:text="@string/verify_phone_number_reason_message"
android:id="@+id/textView4"
android:textSize="@dimen/_12ssp"

@trinadhkoya
Copy link

I don't think so it was because of ssp !! May be binding error I guess !!

@elhanan-mishraky
Copy link
Contributor

Can you try rebuilding the project? I just tried a similar code on android 7.0 emulator and it worked well.

@hmittal1
Copy link
Author

This is not an always. Crash is happening on few android 7.0 devices ( mainly on moto G). Even I also tested it for nexus and pixal and samsung device, it is working fine. Do you know why it is not working for few devices ?

@elhanan-mishraky
Copy link
Contributor

Is it possible that you will try to fix it and send back a pull request?
I have only few devices and no moto G...
If it's not possible please send the list of devices with the issue and I will buy one.

@hmittal1
Copy link
Author

Yah , i am working on this issue. Today i found that this could be because of memory leak mentioned on this stackoverflow page : http://stackoverflow.com/questions/4512981/android-view-inflateexception-binary-xml-file-line-12-error-inflating-class.
I am also working on fixing memory leak issues and let you if i face this crash again.

@selvam75
Copy link

Please update your textview xml tag here, this will help to fix the inflate issue. @hmittal1

@elhanan-mishraky
Copy link
Contributor

Seems like it doesn't relate to sdp, please let me know if I'm wrong.

@vankhoa01
Copy link

Hi,

I get this issue too on Android 7 when user use split-screen mode
I think you should create new dimens folder for split-screen mode

How do you think about that @elhanan-mishraky ?

Thanks a lot

@elhanan-mishraky
Copy link
Contributor

@vankhoa01 is it possible that you will create a pull request with the required fix?

@vankhoa01
Copy link

I just duplicate values-sw300dp and named is values for fixing.
But I think it's not good solution

Could you give me some hint for this case ?

@elhanan-mishraky
Copy link
Contributor

@vankhoa01 I will try to fix it this week.

@vankhoa01
Copy link

Great

@elhanan-mishraky
Copy link
Contributor

@vankhoa01 the fix is published, please use 1.0.5 and let me know if it goes well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants