title: Creating Android AAR file from open source and add it to my own project
body: <p>Hey all I am having a difficult time figuring out why the export of an .aar file does not seem to be working when I add it to my own project.</p>
  <p>I am using the <a href="https://github.com/nambicompany/expandable-fab" rel="nofollow noreferrer">Expanable-tab</a> project and it compiles the library it has to an .aap file via the build.gradle:</p>
  <pre><code>apply plugin: 'com.android.library'
  apply plugin: 'kotlin-android'
  
  ext.versionMajor = 1
  ext.versionMinor = 2
  ext.versionPatch = 1
  
  android {
      compileSdkVersion 30
  
      defaultConfig {
          minSdkVersion 15
          targetSdkVersion 30
          versionCode versionMajor * 100000 + versionMinor * 100 + versionPatch * 1
          versionName &quot;$versionMajor.$versionMinor.$versionPatch&quot;
          setProperty(&quot;archivesBaseName&quot;, &quot;expandable-fab&quot;)
  
          // Changes the name of generated AAR artifacts to be more descriptive
          libraryVariants.all { variant -&gt;
              variant.outputs.all { output -&gt;
                  if (outputFileName.endsWith('.aar')) {
                      outputFileName = &quot;${archivesBaseName}-${versionName}.aar&quot;
                  }
              }
          }
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
  
      sourceSets {
          main.java.srcDirs += 'src/main/kotlin'
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation&quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
      implementation 'com.google.android.material:material:1.4.0'
      implementation 'androidx.appcompat:appcompat:1.3.1'
  }
  
  apply from: 'generate-docs-and-update-website.gradle'
  apply from: 'publish-artifacts-to-maven-repo.gradle'
  </code></pre>
  <p>When I rebuild the project I navigate to the <code>expandable-fab-master\library\build\outputs\aar</code> directory where <code>expandable-fab-1.2.1.aar</code> file has been produced.</p>
  <p><a href="https://i.stack.imgur.com/cZ8Pm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cZ8Pm.png" alt="enter image description here" /></a></p>
  <p>I then copy the .aap file to my libs folder in my own project:</p>
  <p><a href="https://i.stack.imgur.com/rKhJx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rKhJx.png" alt="enter image description here" /></a></p>
  <p>Then I proceed to add this to the build.gradle:</p>
  <p><a href="https://i.stack.imgur.com/hzZbM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hzZbM.png" alt="enter image description here" /></a></p>
  <p>All of this compile when selecting the rebuild option - no errors.</p>
  <p>However, when it gets to the point in my app that uses the expandable-fab code it crashes with this as the error:</p>
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.myapp, PID: 19960
      android.view.InflateException: Binary XML file line #36 in com.myapp:layout/_fragvideoplay1: Binary XML file line #36 in com.myapp:layout/_fragvideoplay1: Error inflating class com.nambimobile.widgets.efab.ExpandableFabLayout
      Caused by: android.view.InflateException: Binary XML file line #36 in com.myapp:layout/_fragvideoplay1: Error inflating class com.nambimobile.widgets.efab.ExpandableFabLayout
      Caused by: java.lang.reflect.InvocationTargetException
  </code></pre>
  <p>And the code its referencing (videoPlay.java:99):</p>
  <p><a href="https://i.stack.imgur.com/XkvRU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XkvRU.png" alt="enter image description here" /></a></p>
  <p>If I comment out the <code>implementation files('libs/expandable-fab-1.2.1.aar')</code> and uncomment the original <code>implementation 'com.nambimobile.widgets:expandable-fab:1.2.1'</code> and then run the app it works as it should...</p>
  <p>What am I missing here?</p>