由于缺少文件,gradle构建失败

时间:2017-07-28 21:24:31

标签: android

我想在android studio 2.3.3中编辑布局时启用自动完成功能,所以我在项目目录中删除了.idea文件夹和.i​​ml文件,并通过导航到文件>使得缓存无效。 Invaliate Caches / restart ...,但是当gradle构建我的项目时遇到另一个问题,那就是我在事件日志中的错误:

28/07/2017
21:56   Gradle sync started

21:56   Platform and Plugin Updates: The following components are ready to update: Android Emulator, Google Play services, Google Repository, Android SDK Platform 26, Google APIs ARM 64 v8a System Image, Google APIs ARM EABI v7a System Image, Google APIs Intel x86 Atom System Image, Google APIs Intel x86 Atom_64 System Image

21:56   FileNotFoundException: Entry fileTemplates//code/Google Test Fixture SetUp Method.cc.ft not found in C:/Program Files/Android/Android Studio/lib/idea.jar

21:56   Gradle sync completed

21:56   Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]

21:56   Gradle build finished with 3 error(s) in 4s 181ms

22:19   Enable smart keyboard internationalization for Studio.: We have found out that you are using a non-english keyboard layout. You can enable smart layout support for français language.You can change this option in the settings of Studio more...

这是我的傻瓜:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.example.andoid.sunshine.app"
        minSdkVersion 15
        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 {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:26.+'
    testCompile 'junit:junit:4.12'
}

提前谢谢你解决我的问题

1 个答案:

答案 0 :(得分:0)

在32位计算机上安装64位版本的android studio时,可能会出现此问题。有关详细说明,请参阅this