app.iml文件问题

时间:2018-04-03 16:04:58

标签: android android-studio build.gradle gradle-dependencies

我在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'
}

1 个答案:

答案 0 :(得分:1)

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

<强>更新

由于运行implementation 'com.firebaseui:firebase-ui:0.6.2'

所示的./gradlew app:dependencies而添加了它

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