0

I created a new empty project in Android Studio in order to follow a youtube tutorial (https://www.youtube.com/watch?v=Xn0tQHpMDnM). About 10% of the way into the tutorial my project would no longer compile - it did not like the following line in my gradle file:

implementation 'com.android.support:appcompat-v7:26.1.0'

saying that all entries for com.android.support had to be the same version and it had also found

com.android.support:palette-v7-25.0.0

There is no such line in my build.gradle file. Searching through this newly created project I find the following line in a huge file named app.iml

<orderEntry type="library" name="com.android.support:palette-v7-25.0.0" level="project" />

I have no idea what the app.iml is for or why this line is in it. What is wrong? How can I resolve this issue. Why does the app.iml have this line in it?

gradle file and app.iml pasted below . . .

<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="android-gradle" name="Android-Gradle">
      <configuration>
        <option name="GRADLE_PROJECT_PATH" value=":app" />
      </configuration>
    </facet>
    <facet type="android" name="Android">
      <configuration>
        <option name="SELECTED_BUILD_VARIANT" value="debug" />
        <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
        <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
        <afterSyncTasks>
          <task>generateDebugSources</task>
        </afterSyncTasks>
        <option name="ALLOW_USER_CONFIGURATION" value="false" />
        <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
        <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
        <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
        <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
    <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
    <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/splits-support" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
      <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
    </content>
    <orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" name="com.google.android.gms:play-services-base-9.8.0" level="project" />
    <orderEntry type="library" name="com.android.support:support-media-compat-26.1.0" level="project" />
    <orderEntry type="library" name="com.android.support:customtabs-23.4.0" level="project" />
    <orderEntry type="library" name="com.facebook.android:facebook-android-sdk-4.14.1" level="project" />
    <orderEntry type="library" name="com.android.support:recyclerview-v7-26.1.0" level="project" />
    <orderEntry type="library" name="android.arch.lifecycle:common:1.0.0@jar" level="project" />
    <orderEntry type="library" name="com.firebaseui:firebase-ui-auth-0.6.2" level="project" />
    <orderEntry type="library" name="com.google.android.gms:play-services-auth-base-9.8.0" level="project" />
    <orderEntry type="library" name="com.android.support:support-fragment-26.1.0" level="project" />
    <orderEntry type="library" name="com.android.support:support-vector-drawable-26.1.0" level="project" />
    <orderEntry type="library" name="android.arch.lifecycle:runtime-1.0.0" level="project" />
    <orderEntry type="library" name="com.parse.bolts:bolts-tasks:1.4.0@jar" level="project" />
    <orderEntry type="library" name="com.google.android.gms:play-services-basement-9.8.0" level="project" />
    <orderEntry type="library" name="com.android.support:appcompat-v7-26.1.0" level="project" />
    <orderEntry type="library" name="com.parse.bolts:bolts-applinks:1.4.0@jar" level="project" />
    <orderEntry type="library" name="com.android.support:support-annotations:26.1.0@jar" level="project" />
    <orderEntry type="library" name="com.google.firebase:firebase-database-connection-9.8.0" level="project" />
    <orderEntry type="library" name="com.google.firebase:firebase-storage-9.8.0" level="project" />
    <orderEntry type="library" name="com.firebaseui:firebase-ui-database-0.6.2" level="project" />
    <orderEntry type="library" name="com.android.support.constraint:constraint-layout-solver:1.0.2@jar" level="project" />
    <orderEntry type="library" name="com.android.support:support-core-utils-26.1.0" level="project" />
    <orderEntry type="library" name="com.android.support.constraint:constraint-layout-1.0.2" level="project" />
    <orderEntry type="library" name="com.android.support:support-core-ui-26.1.0" level="project" />
    <orderEntry type="library" name="com.google.android.gms:play-services-auth-9.8.0" level="project" />
    <orderEntry type="library" name="com.firebaseui:firebase-ui-0.6.2" level="project" />
    <orderEntry type="library" name="com.android.support:support-compat-26.1.0" level="project" />
    <orderEntry type="library" name="com.google.firebase:firebase-auth-9.8.0" level="project" />
    <orderEntry type="library" name="com.parse.bolts:bolts-android:1.4.0@jar" level="project" />
    <orderEntry type="library" name="com.firebaseui:firebase-ui-storage-0.6.2" level="project" />
    <orderEntry type="library" name="com.google.firebase:firebase-database-9.8.0" level="project" />
    <orderEntry type="library" name="android.arch.core:common:1.0.0@jar" level="project" />
    <orderEntry type="library" name="com.android.support:cardview-v7-23.4.0" level="project" />
    <orderEntry type="library" name="com.google.firebase:firebase-auth-module-9.8.0" level="project" />
    <orderEntry type="library" name="com.google.firebase:firebase-auth-common-9.8.0" level="project" />
    <orderEntry type="library" name="com.google.firebase:firebase-common-9.8.0" level="project" />
    <orderEntry type="library" name="com.google.android.gms:play-services-tasks-9.8.0" level="project" />
    <orderEntry type="library" name="com.android.support:support-v4-26.1.0" level="project" />
    <orderEntry type="library" name="com.google.firebase:firebase-storage-common-9.8.0" level="project" />
    <orderEntry type="library" name="com.android.support:animated-vector-drawable-26.1.0" level="project" />
    <orderEntry type="library" name="com.android.support:design-26.1.0" level="project" />
    <orderEntry type="library" name="com.android.support:transition-26.1.0" level="project" />
    <orderEntry type="library" name="com.github.bumptech.glide:glide:3.7.0@jar" level="project" />
    <orderEntry type="library" name="com.android.support:palette-v7-25.0.0" level="project" />
    <orderEntry type="library" name="android-android-26" level="project" />
  </component>
</module>


apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "deanblakely.com.fbchat"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    //testImplementation 'junit:junit:4.12'
    //androidTestImplementation 'com.android.support.test:runner:1.0.1'
    //androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    //add library
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.firebaseui:firebase-ui:0.6.2'
}
Dean Blakely
  • 3,535
  • 11
  • 51
  • 83

1 Answers1

1

It is because this tutorial is using version 25.0.1 and you have downloaded its sample and are using it, so it has this in its configurations and generated files. If you decided to change the version of support library to 26.1.0 then you need to clean the project or manually remove the content of build folders. Then run build in your project to regenerate those files.

UPDATE

It is added because of implementation 'com.firebaseui:firebase-ui:0.6.2' as it shown by running ./gradlew app:dependencies

dependencies of com.firebaseui:firebase-ui:0.6.2 library

Akram
  • 2,158
  • 1
  • 17
  • 24
  • No. This was an empty project built new from Android Studio. The question is why is the palette library set to 25.0.0. This happened when I added the two libraries to my gradle. – Dean Blakely Apr 03 '18 at 23:54
  • Can you post your `build.gradle` file? maybe it is a dependency's dependency. – Akram Apr 04 '18 at 07:46
  • The build gradle is there after the iml file – Dean Blakely Apr 04 '18 at 15:28
  • @DeanBlakely Thanks, I haven't seen it. I have updated my answer by checking the `build.gradle` file. – Akram Apr 04 '18 at 16:51
  • Yes. That's what I have also found. The tutorial was old so I had to update all of the libraries used. I just used + and got version 12.0.1 which does not cause the problem. Thanks. – Dean Blakely Apr 06 '18 at 16:15