Android Resources$NotFoundException when inflating activity from library project
<p>What could cause this problem when I added the MuPDF library to my project.</p>

<p>This is the error log:</p>

<pre><code>FATAL EXCEPTION: main
        Process: ch.my.app, PID: 18899
        java.lang.RuntimeException: Unable to start activity ComponentInfo{ch.my.app/com.artifex.mupdflib.MuPDFActivity}: android.content.res.Resources$NotFoundException: File  from drawable resource ID #0x7f0d000f: .xml extension required
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3119)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3218)
            at android.app.ActivityThread.access$1000(ActivityThread.java:198)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:145)
            at android.app.ActivityThread.main(ActivityThread.java:6837)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
         Caused by: android.content.res.Resources$NotFoundException: File  from drawable resource ID #0x7f0d000f: .xml extension required
            at android.content.res.Resources.twLoadColorStateList(Resources.java:4013)
            at android.content.res.Resources.loadColorStateList(Resources.java:3943)
            at android.content.res.Resources.getColor(Resources.java:2072)
            at com.artifex.mupdflib.MuPDFActivity.onCreate(MuPDFActivity.java:295)
            at android.app.Activity.performCreate(Activity.java:6500)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3072)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3218) 
            at android.app.ActivityThread.access$1000(ActivityThread.java:198) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676) 
            at android.os.Handler.dispatchMessage(Handler.java:102) 
            at android.os.Looper.loop(Looper.java:145) 
            at android.app.ActivityThread.main(ActivityThread.java:6837) 
            at java.lang.reflect.Method.invoke(Native Method) 
            at java.lang.reflect.Method.invoke(Method.java:372) 
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 
</code></pre>

<p>I am adding MuPDF library as module, this is the settings.gradle</p>

<pre><code>include ':app'
include ':library_MuPDF'
</code></pre>

<p>And the build.gradle for module app contains:</p>

<pre><code>apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    minSdkVersion 8
    targetSdkVersion 23
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
}

dependencies {
    compile 'com.android.support:support-v4:22.2.1'
}
</code></pre>

<p>And the project gradle:</p>

<pre><code>buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
</code></pre>

<p>Android studio is not showing any problems.
This is the code where it is crashing:</p>

<pre><code>getWindow().setStatusBarColor(getResources().getColor(R.color.actionbar_background_dark));
</code></pre>

<p>When I disable this, the problem is when inflating:</p>

<pre><code>mButtonsView = getLayoutInflater().inflate(R.layout.buttons, null);
</code></pre>

<p>This is the inflating error:</p>

<pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
    Process: ch.app.app, PID: 3283
    java.lang.RuntimeException: Unable to start activity ComponentInfo{ch.app.app/com.artifex.mupdflib.MuPDFActivity}: android.view.InflateException: Binary XML file line #14: Binary XML file line #14: Error inflating class &lt;unknown&gt;
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2484)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2544)
        at android.app.ActivityThread.access$900(ActivityThread.java:150)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:168)
        at android.app.ActivityThread.main(ActivityThread.java:5845)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
     Caused by: android.view.InflateException: Binary XML file line #14: Binary XML file line #14: Error inflating class &lt;unknown&gt;
        at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at com.artifex.mupdflib.MuPDFActivity.makeButtonsView(MuPDFActivity.java:1091)
        at com.artifex.mupdflib.MuPDFActivity.createUI(MuPDFActivity.java:587)
        at com.artifex.mupdflib.MuPDFActivity.onCreate(MuPDFActivity.java:473)
        at android.app.Activity.performCreate(Activity.java:6248)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2437)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2544) 
        at android.app.ActivityThread.access$900(ActivityThread.java:150) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:168) 
        at android.app.ActivityThread.main(ActivityThread.java:5845) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687) 
</code></pre>

<p>Everything what I checked looks correctly, I cleaned the project, did clean install of the app, removed all other apps using this library and this problem is still happening.</p>

<p>Where could I look for some another possible problems?</p>

<p>Thanks</p>