app.iml 文件有问题

Issue with app.iml file

我在 Android Studio 中创建了一个新的空项目,以便遵循 youtube 教程 (https://www.youtube.com/watch?v=Xn0tQHpMDnM)。教程进行到大约 10% 时,我的项目将不再编译 - 它不喜欢我的 gradle 文件中的以下行:

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

说 com.android.support 的所有条目必须是同一版本并且它还找到了

com.android.support:palette-v7-25.0.0

我的 build.gradle 文件中没有这一行。搜索这个新创建的项目,我在一个名为 app.iml

的大文件中找到以下行
<orderEntry type="library" name="com.android.support:palette-v7-25.0.0" level="project" />

我不知道 app.iml 是干什么用的,也不知道为什么要加这一行。怎么了?我该如何解决这个问题。为什么 app.iml 里面有这一行?

gradle 文件和 app.iml 粘贴在下方。 . .

<?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'
}

因为本教程使用的是版本25.0.1,并且您已经下载了它的示例并正在使用它,所以它的配置和生成的文件中都有这个。如果您决定将支持库的版本更改为 26.1.0,那么您需要 clean 项目或手动删除 build 文件夹的内容。然后 运行 build 在你的项目中重新生成那些文件。

更新

因为implementation 'com.firebaseui:firebase-ui:0.6.2'添加的,如运行ning ./gradlew app:dependencies

所示