question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: android.view.InflateException: Binary XML file line #28: Error inflating class de.hdodenhof.circleimageview.CircleImageView

See original GitHub issue

Hi, Thank you for your project ^^;

I found an crash. I just add [compile ‘com.google.android.gms:play-services-analytics:8.3.0’] in my gradle, and add code in my main activity. however, if I delete that code my app is ok.

this is my build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"



    defaultConfig {
        applicationId "com.xxx.xxx"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 152
        versionName "4.4.1"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    /*productFlavors {
        dev {
            minSdkVersion 15
        }
        prod {
            minSdkVersion 15
        }
    }*/
}



dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.0'           //Support Library
    compile 'com.android.support:cardview-v7:23.1.0'            //CardView Library
    compile 'com.android.support:gridlayout-v7:23.1.0'          //GridLayout Library
    compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'com.android.support:palette-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'                 //Design Support Library

    compile 'com.github.rey5137:material:1.2.1'                 //Material Design Support/ https://github.com/rey5137/material

    compile 'com.squareup.retrofit:retrofit:1.9.0'              //Network Library
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
    compile 'com.github.bumptech.glide:glide:3.6.1'             //Network Image Library/    https://github.com/bumptech/glide
    compile 'com.github.bumptech.glide:okhttp-integration:1.3.1'
    compile 'com.squareup.okhttp:okhttp:2.5.0'                  //Network Client/           http://square.github.io/okhttp/

    compile 'de.hdodenhof:circleimageview:2.0.0'                //Circle Image             https://github.com/hdodenhof/CircleImageView

    compile 'com.facebook.android:facebook-android-sdk:4.1.0'   //facebook sdk

    compile 'com.google.android.gms:play-services-analytics:8.3.0'
}

and my Application.java

 private Tracker tracker;

    synchronized public Tracker getDefaultTracker() {
        if (tracker == null) {
            GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
            tracker = analytics.newTracker(R.xml.global_tracker);
        }

        return tracker;
    }

and my MainActivity.java

Application application = (Application) getApplication();
        Tracker tracker = application.getDefaultTracker();
        tracker.setScreenName(MainActivity.class.getName());
        tracker.send(new HitBuilders.ScreenViewBuilder().build());

and than Exception message

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.xxx/com.xxx.xxx.activity.MainActivity}: android.view.InflateException: Binary XML file line #28: Error inflating class de.hdodenhof.circleimageview.CircleImageView
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2067)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092)
    at android.app.ActivityThread.access$600(ActivityThread.java:138)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4874)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #28: Error inflating class de.hdodenhof.circleimageview.CircleImageView
    at android.view.LayoutInflater.createView(LayoutInflater.java:613)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:830)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:736)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
    at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
    at com.xxx.xxx.activity.MainActivity.onCreate(MainActivity.java:96)
    at android.app.Activity.performCreate(Activity.java:5008)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2031)
    ... 11 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.constructNative(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
    at android.view.LayoutInflater.createView(LayoutInflater.java:587)
    ... 28 more
Caused by: java.lang.NoClassDefFoundError: de.hdodenhof.circleimageview.R$styleable
    at de.hdodenhof.circleimageview.CircleImageView.<init>(CircleImageView.java:71)
    at de.hdodenhof.circleimageview.CircleImageView.<init>(CircleImageView.java:65)
    ... 31 more

thank you,

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
ydfebricommented, Apr 13, 2016

I have some way to fix this problem. Why this problem is coming.

  1. problem. This article explain we have method more than 65k.
  2. how to fix.
  3. how to fix if we use google analytic. I hope this realy helpful. sorry for my bad english.
4reactions
varotariyavmcommented, Jul 26, 2018

I just remove android:scaleType=“fitCenter” from imageview xml and its working fine now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Error inflating class de.hdodenhof.circleimageview ...
IllegalArgumentException: ScaleType FIT_CENTER not supported. Solution: Remove android:scaleType="fitCenter" from the layout xml file.
Read more >
Binary XML file line Error inflating class ImageView in Android ...
InflateException : Binary XML file line | Error inflating class ImageViewfacebook page : https://www.facebook.com/Code-Prof-110511874050372/
Read more >
How to Create a CircularImageView in Android using ...
Create a CircleImageView inside the activity_main.xml file and set the android:src=”@drawable/mountain”. The complete code of the activity_main.
Read more >
Android – BottomNavigationView inflate error after migrating to ...
MainActivity}: android.view.InflateException: Binary XML file line #16: Binary XML file line #16: Error inflating class android.support.design.widget.
Read more >
error-inflating-class-de-hdodenhof-circleimageview-circ
android.view.InflateException: Binary XML file line #96: Error inflating class 明显可以看出是xml布局文件导致的错,但是布局文件并没有提示 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found