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

Failed to inflate - Binary XML file line #* - Error inflating class com.gc.materialdesign.views.* #102

Open
Inoy1st opened this issue Jan 16, 2015 · 5 comments

Comments

@Inoy1st
Copy link

Inoy1st commented Jan 16, 2015

Using last Android Studio.
Getting this error in DEMO project (after fixing and adding dependencies)

Error - on activity open - setContentView(R.layout.activity_buttons);

Failed to inflate    android.view.InflateException: Binary XML file line #78: Error inflating class com.gc.materialdesign.views.Slider

It is not the Slider problem. There are Slider, checkbox, ButtonIcon, etc ...

I guess problem is how Library added to Android Studio, but I don't see what can be wrong. Here is my gradle files (only important parts)

Project gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
    }
}
...

DEMO gradle

...
dependencies {
    compile 'com.android.support:support-v4:21.+'
    compile project(':materialDesign')
}

Library gradle

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.github.dcendents:android-maven-plugin:1.2'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
    }
}

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
...

Here is full error log:

Failed to inflate
    android.view.InflateException: Binary XML file line #138: Error inflating class com.gc.materialdesign.views.ButtonIcon
            at android.view.LayoutInflater.createView(LayoutInflater.java:518)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213)
            at android.app.Activity.setContentView(Activity.java:1657)
            at com.gc.materialdesigndemo.ui.ButtonsActivity.onCreate(ButtonsActivity.java:22)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
            at android.app.ActivityThread.access$1500(ActivityThread.java:123)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3835)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
            at android.view.LayoutInflater.createView(LayoutInflater.java:505)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213)
            at android.app.Activity.setContentView(Activity.java:1657)
            at com.gc.materialdesigndemo.ui.ButtonsActivity.onCreate(ButtonsActivity.java:22)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
            at android.app.ActivityThread.access$1500(ActivityThread.java:123)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3835)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NoSuchMethodError: com.gc.materialdesign.views.ButtonIcon.setBackground
            at com.gc.materialdesign.views.ButtonIcon.<init>(ButtonIcon.java:18)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
            at android.view.LayoutInflater.createView(LayoutInflater.java:505)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213)
            at android.app.Activity.setContentView(Activity.java:1657)
            at com.gc.materialdesigndemo.ui.ButtonsActivity.onCreate(ButtonsActivity.java:22)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
            at android.app.ActivityThread.access$1500(ActivityThread.java:123)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3835)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
            at dalvik.system.NativeStart.main(Native Method)
01-16 10:11:19.948    1484-1484/com.gc.materialdesign D/AndroidRuntime﹕ Shutting down VM
01-16 10:11:19.948    1484-1484/com.gc.materialdesign W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x40018560)
01-16 10:11:19.968    1484-1484/com.gc.materialdesign E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gc.materialdesign/com.gc.materialdesigndemo.ui.ButtonsActivity}: android.view.InflateException: Binary XML file line #138: Error inflating class com.gc.materialdesign.views.ButtonIcon
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1768)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
            at android.app.ActivityThread.access$1500(ActivityThread.java:123)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3835)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #138: Error inflating class com.gc.materialdesign.views.ButtonIcon
            at android.view.LayoutInflater.createView(LayoutInflater.java:518)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213)
            at android.app.Activity.setContentView(Activity.java:1657)
            at com.gc.materialdesigndemo.ui.ButtonsActivity.onCreate(ButtonsActivity.java:22)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
            at android.app.ActivityThread.access$1500(ActivityThread.java:123)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3835)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
            at android.view.LayoutInflater.createView(LayoutInflater.java:505)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213)
            at android.app.Activity.setContentView(Activity.java:1657)
            at com.gc.materialdesigndemo.ui.ButtonsActivity.onCreate(ButtonsActivity.java:22)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
            at android.app.ActivityThread.access$1500(ActivityThread.java:123)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3835)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NoSuchMethodError: com.gc.materialdesign.views.ButtonIcon.setBackground
            at com.gc.materialdesign.views.ButtonIcon.<init>(ButtonIcon.java:18)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
            at android.view.LayoutInflater.createView(LayoutInflater.java:505)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:213)
            at android.app.Activity.setContentView(Activity.java:1657)
            at com.gc.materialdesigndemo.ui.ButtonsActivity.onCreate(ButtonsActivity.java:22)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
            at android.app.ActivityThread.access$1500(ActivityThread.java:123)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3835)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
            at dalvik.system.NativeStart.main(Native Method)

Really don't know how to fix this.
Please help

@navasmdc
Copy link
Owner

Hi friend, i found the error, I'll fix it in the next version. I'm picking errors to generate new version, it will be available tomorrow or the next day. I will notify to you when I'll upload the new version

@Inoy1st
Copy link
Author

Inoy1st commented Jan 17, 2015

@navasmdc Thanks, man!

I was not really sure is this error on my side or somewhere else.
Yesterday I've moved project to Eclipse and got rid of compile errors. Run app and got this error again. It was already 3 a.m. and I thought it was good conclusion for a day )

@navasmdc have you received my email? (Steel Rat)

@Inoy1st
Copy link
Author

Inoy1st commented Jan 21, 2015

@navasmdc
I heard, some developers, sometimes, use developer branch for all new features, testing, etc, and master branch for final releases for Library and Demo. It must be a good practice, but it's hard to find all bugs.

@Drakot
Copy link

Drakot commented Jan 24, 2015

It is also happening to me. Is there any fix? I was very excited when I found this lib!

@casaucao
Copy link

casaucao commented Mar 8, 2015

Same error here. Any fix?

xcelder added a commit that referenced this issue Nov 7, 2016
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

4 participants