title: AAPT: error: resource not found, but it is present in styles.xml
body: <p>Full error is</p>
  
  <pre><code>AAPT: error: resource style/AppTheme (aka com.mukmenev.android.findjob:style/AppTheme) not found.
  </code></pre>
  
  <p>However <code>&lt;style name="AppTheme"&gt;</code> is present in <code>app\src\res\values\styles.xml</code></p>
  
  <p>The error points to the generated file</p>
  
  <pre><code>app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml
  </code></pre>
  
  <p>which has declarations that I don't have in the main manifest, like</p>
  
  <pre><code>&lt;uses-sdk
      android:minSdkVersion="19"
      android:targetSdkVersion="23" /&gt;
  
  &lt;application
      android:name="com.mukmenev.android.findjob.App"
      android:allowBackup="true"
      android:debuggable="true"
      android:hardwareAccelerated="false"
      android:label="@string/app_name"
      android:largeHeap="true"
      android:supportsRtl="true"
      android:theme="@style/AppTheme" &gt;
  </code></pre>
  
  <p>So another question is how can it be possible and how to get rid of them?</p>
  
  <p><hr>
  <em>I've just spent about a week trying to launch this project (given to me by previous developer who is refusing to explain anything) and eliminating errors like links to non-existent resources, but these ones are present and visible by eye.</em> <br>
  <hr>
  So how can I make the resources visible for build and what makes the generated manifest look as it looks?
  <br>
  <strong>upd</strong>
  <br>
  After fixing some more errors it came up with several errors like:</p>
  
  <pre><code>:app:mergeDebugResources
  [string/default_web_client_id] \app\src\main\res\values\strings.xml [string/default_web_client_id] \app\build\generated\res\google-services\debug\values\values.xml: Error: Duplicate resources
  </code></pre>
  
  <p>So again, resources get duplicated in a generated file.
  <br>
  <strong>upd 2</strong>
  <br>
  After commenting those out it gives:</p>
  
  <pre><code>Execution failed for task ':app:mergeDebugResources'.
  &gt; java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
    Output:  \app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2100: error: duplicate value for resource 'attr/navigationMode' with config ''.
    \app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2100: error: resource previously defined here.
  </code></pre>
  
  <p>and </p>
  
  <pre><code> Command: C:\gradle-4.6\bin\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\4627eedc0a8af356ec87f9d6cd62c57c\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \
            -o \
            C:\_com_bucket\komirger-static_branch\app\build\intermediates\res\merged\debug \
            C:\_com_bucket\komirger-static_branch\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
    Daemon:  AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
    Output:  C:\gradle-4.6\bin\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\5e49e71c0795be6393bc5ece684619fc\res\values\values.xml:71:5-86:1291: AAPT: error: duplicate value for resource 'attr/navigationMode' with config ''.
  
    C:\gradle-4.6\bin\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\5e49e71c0795be6393bc5ece684619fc\res\values\values.xml:71:5-86:1291: AAPT: error: resource previously defined here.
  </code></pre>
  
  <p>I tried invalidating caches in Android Studio but with no effect. Any ideas?</p>