title: Error when trying to use a PieChart (hellocharts) on an Activity
body: <p>I'm trying to use the external library &quot;hellocharts&quot; in my project. I have linked the library to my project already, but when the activity that has the chart starts, the whole app crash with the exception: &quot;Error inflating class lecho.lib.hellocharts.view.PieChartView&quot;.</p>
  <p>I don't know what the problem can be. The java class (when I use the Charts) don't seem to have that problem (it doesn't get compile errors of not finding the library).</p>
  <p>Here it is the .xml file of the activity</p>
  <pre><code>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:orientation=&quot;vertical&quot;&gt;
      &lt;HorizontalScrollView
          android:id=&quot;@+id/horizontalScrollView&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;80dp&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;
  
          &lt;LinearLayout
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;match_parent&quot;&gt;
  
              &lt;Button
                  android:id=&quot;@+id/Dia&quot;
                  style=&quot;@android:style/Widget.Button&quot;
                  android:layout_width=&quot;80dp&quot;
                  android:layout_height=&quot;80dp&quot;
                  android:layout_marginBottom=&quot;8dp&quot;
                  android:text=&quot;Dia&quot; /&gt;
  
              &lt;Button
                  android:id=&quot;@+id/Semana&quot;
                  style=&quot;@android:style/Widget.Button&quot;
                  android:layout_width=&quot;80dp&quot;
                  android:layout_height=&quot;80dp&quot;
                  android:text=&quot;Semana&quot; /&gt;
  
              &lt;Button
                  android:id=&quot;@+id/Mes&quot;
                  style=&quot;@android:style/Widget.Button&quot;
                  android:layout_width=&quot;80dp&quot;
                  android:layout_height=&quot;80dp&quot;
                  android:text=&quot;Mes&quot; /&gt;
  
              &lt;Button
                  android:id=&quot;@+id/Temporizador&quot;
                  style=&quot;@android:style/Widget.Button&quot;
                  android:layout_width=&quot;80dp&quot;
                  android:layout_height=&quot;80dp&quot;
                  android:text=&quot;Temp&quot; /&gt;
  
              &lt;Button
                  android:id=&quot;@+id/Estadisticas&quot;
                  style=&quot;@android:style/Widget.Button&quot;
                  android:layout_width=&quot;80dp&quot;
                  android:layout_height=&quot;80dp&quot;
                  android:text=&quot;Stats&quot; /&gt;
  
              &lt;Button
                  android:id=&quot;@+id/Tienda&quot;
                  style=&quot;@android:style/Widget.Button&quot;
                  android:layout_width=&quot;80dp&quot;
                  android:layout_height=&quot;80dp&quot;
                  android:text=&quot;Tienda&quot; /&gt;
          &lt;/LinearLayout&gt;
      &lt;/HorizontalScrollView&gt;
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;&gt;
  
          &lt;lecho.lib.hellocharts.view.PieChartView
              android:id=&quot;@+id/graphic_pie_chart&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;500dp&quot;
              app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintHorizontal_bias=&quot;0.0&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot;
              app:layout_constraintVertical_bias=&quot;0.826&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/tv_asignatura&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:textSize=&quot;28sp&quot;
              android:textStyle=&quot;bold&quot;
              android:layout_gravity=&quot;center&quot;
              app:layout_constraintBottom_toTopOf=&quot;@+id/graphic_pie_chart&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintStart_toStartOf=&quot;@+id/graphic_pie_chart&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot;
              app:layout_constraintVertical_bias=&quot;0.3&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/tv_tiempo&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:textSize=&quot;20sp&quot;
              android:layout_gravity=&quot;center&quot;
              app:layout_constraintBottom_toTopOf=&quot;@+id/graphic_pie_chart&quot;
              app:layout_constraintEnd_toEndOf=&quot;@+id/tv_asignatura&quot;
              app:layout_constraintStart_toStartOf=&quot;@+id/tv_asignatura&quot;
              app:layout_constraintTop_toBottomOf=&quot;@+id/tv_asignatura&quot;
              app:layout_constraintVertical_bias=&quot;0.45&quot; /&gt;
  
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>And here it is the gradle files</p>
  <pre><code>plugins {
      id 'com.android.application'
  }
  
  android {
      compileSdkVersion 31
  
      defaultConfig {
          applicationId &quot;es.ucm&quot;
          minSdkVersion 26
          targetSdkVersion 31
          versionCode 1
          versionName &quot;1.0&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  }
  
  dependencies {
  
      implementation 'androidx.appcompat:appcompat:1.4.1'
      implementation 'com.google.android.material:material:1.5.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
      testImplementation 'junit:junit:4.+'
      androidTestImplementation 'androidx.test.ext:junit:1.1.3'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
      implementation 'com.github.lecho:hellocharts-library:1.5.8@aar'
  }
  
  // Top-level build file where you can add configuration options common to all sub-projects/modules.
  buildscript {
      repositories {
          google()
          mavenCentral()
      }
      dependencies {
          classpath &quot;com.android.tools.build:gradle:4.2.2&quot;
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          google()
          mavenCentral()
          jcenter()// Warning: this repository is going to shut down soon
  
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>