title: The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally but:
body: <p>This error message started to prevent building my <strong>Flutter</strong> app after upgrading one of the native <strong>java</strong> libraries used by the app:</p>
  <pre><code>A problem occurred configuring root project 'android'.
  &gt; Could not resolve all artifacts for configuration ':classpath'.
     &gt; Could not resolve androidx.room:room-runtime:2.3.0-rc01.
       Required by:
           project : &gt; no.nordicsemi.android:mesh:3.1.5
        &gt; No matching variant of androidx.room:room-runtime:2.3.0-rc01 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally but:
            - Variant 'releaseApiPublication' capability androidx.room:room-runtime:2.3.0-rc01 declares a library, and its dependencies declared externally:
                - Incompatible because this component declares an API of a component, with the library elements 'aar' and the consumer needed a runtime of a component, packaged as a jar
                - Other compatible attribute:
                    - Doesn't say anything about its target Java version (required compatibility with Java 11)
            - Variant 'releaseRuntimePublication' capability androidx.room:room-runtime:2.3.0-rc01 declares a runtime of a library, and its dependencies declared externally:
                - Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, packaged as a jar
                - Other compatible attribute:
                    - Doesn't say anything about its target Java version (required compatibility with Java 11)
            - Variant 'sourcesElements' capability androidx.room:room-runtime:2.3.0-rc01 declares a runtime of a component, and its dependencies declared externally:
                - Incompatible because this component declares documentation and the consumer needed a library
                - Other compatible attributes:
                    - Doesn't say anything about its target Java version (required compatibility with Java 11)
                    - Doesn't say anything about its elements (required them packaged as a jar)
  </code></pre>
  <p>The projects build.gradle file contains (amongst others):</p>
  <pre><code>dependencies {
      implementation fileTree(dir: 'mesh-release', include:['*.aar'])
  
      implementation 'no.nordicsemi.android:mesh:3.1.5'
  
      implementation 'androidx.room:room-runtime:2.3.0-rc01'
      annotationProcessor 'androidx.room:room-compiler:2.3.0-rc01'
      androidTestImplementation 'androidx.room:room-testing:2.3.0-rc01'
  }
  </code></pre>
  <p>The library's aar file (<code>mesh-release.aar</code>) is stored in a folder named <code>mesh-release</code> which also contains a file with the following content:</p>
  <pre><code>configurations.maybeCreate(&quot;default&quot;)
  artifacts.add(&quot;default&quot;, file('mesh-release.aar'))
  </code></pre>
  <p>Do you have any ideas how to fix that? Downgrading to the previously used version is unfortunately not an option...</p>