简体   繁体   English

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

[英]gradle build is failed due to missing file

I wanted enable autocompletion when editing layout in android studio 2.3.3 ,so i deleted .idea folder and .iml files inside my project directory and i maked caches invalidated by navigating to Files> Invaliate Caches/restart..., but I encounter another problem when gradle build my project , that's my errors in Event Log: 我想在android studio 2.3.3中编辑布局时启用自动补全功能,所以我删除了项目目录中的.idea文件夹和.i​​ml文件,并通过导航到“文件”>“无用的缓存/重新启动...”使缓存无效,但是我遇到了另一个问题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...

that's my gradle: 那是我的荣幸:

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

In advance thank you for solving my problem 预先感谢您解决我的问题

When 64 bit version of android studio is installed on a 32 bit machine, this issue may occur. 在32位计算机上安装64位版本的android studio时,可能会出现此问题。 Refer this for more clarification. 请参阅以获取更多说明。

  • Uninstall your 64 bit android studio and install 32 bit version of the same. 卸载您的64位android studio并安装相同的32位版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 由于缺少keystore.properties文件,Gradle构建失败 - Gradle build failing due to keystore.properties file missing build.gradle:由于“没有这样的文件或目录”,命令行任务失败 - build.gradle: commandLine task failed due to "No such file or directory" 由于缺少 android SDK,Jenkins 构建失败 - Jenkins build failed due to missing android SDK 由于 Java 文件中“缺少” Parcelable 类,Android Studio/Gradle 无法构建 - Android Studio/Gradle fails to build due “missing” Parcelable class in java file 由于缺少jcenter证书,无法构建现有应用程序-被gradle阻止 - Failed to build an existing application due to lack of jcenter certificate - blocked by gradle 在启用ProGuard的情况下,Gradle构建失败,缺少classes.jar - Gradle Build failed with ProGuard enabled, missing classes.jar Gradle Build因“错误:任务执行失败”而崩溃:app:mergeDebugResources'。 > Crunching Cruncher photo.png失败了“ - Gradle Build Fails Due to “Error:Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher photo.png failed” 应用程序因Gradle而无法运行 - Application Failed To Run Due To Gradle 很可能是由于应用程序的 build.gradle 中缺少 applicationId 变量 - Most likely due to a missing applicationId variable in application's build.gradle Android Gradle 构建失败 - Android Gradle Build Failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM