Gradle Build失败:在根项目

时间:2016-03-10 08:11:21

标签: java android android-gradle build.gradle

我知道这个问题被多次询问,并且我使用了所有的答案来解决我的错误。这是我的问题。 我尝试了几乎所有的答案,所以请在将我的问题标记为重复之前,请阅读我的问题护理,我提到了所有在SO问题上回答的步骤。

每当我尝试运行/构建/清理项目时,我都会收到错误 *出了什么问题: 在根项目'project'中找不到任务'stacktrace'。

图书馆和Sdk我正在使用 ViewPagerIndicator - JakeWharton Facebook SDK PDK(Pinterest sdk) gcm.jar 的HttpCore-4.4.4.jar

到目前为止我尝试了什么

  1. 将Gradle版本从2.2.1-all.zip更改为较低版本
  2. 更改Gradle Build版本
  3. 删除所有库并运行
  4. 所有库项目minSdkVersion相同(我的项目使用minSdkVersion:11)
  5. 清理项目并重建
  6. 使缓存无效并重新启动Android Studio
  7. 删除.idea和.gradle文件夹,然后导入项目
  8. 创建新项目并将旧项目粘贴到项目中,但在构建
  9. 时也会出现相同的错误
  10. 从用户文件夹中删除.gradle文件夹(我使用的是Windows 7)
  11. 尝试使用命令行构建项目
  12. 更改了JDK版本新jdk1.8.0_73(我的项目是在jdk1.7.0_55上构建的)here is thread that said using new JDK version will resolve problem
  13. 这里是我的回复first solution Second solution third solution Fourth Answer等等。
  14. 临时解决方案(以前工作但现在不工作) 我有两个星期前的项目备份,我导入该备份项目并替换文件,它的工作原理 但是,当我做清洁项目错误再来时

    这是app level build.gradle文件

    apply plugin: 'com.android.application'
    apply plugin: 'com.google.gms.google-services'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"
    
        defaultConfig {
            applicationId "XXX"
            minSdkVersion 11
            targetSdkVersion 23
            multiDexEnabled true
    
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
    }
    
    dependencies {
        compile 'com.android.support:appcompat-v7:23.1.1'
        compile 'com.android.support:design:23.1.1'
        compile 'com.android.support:support-v4:23.1.1'
        compile project(':library')
        compile files('libs/picasso-2.5.2.jar')
        compile files('libs/jsoup-1.8.3.jar')
        compile files('libs/httpcore-4.4.4.jar')
        compile 'com.google.android.gms:play-services:8.3.0'
        compile files('libs/gcm.jar')
        compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    
    }
    android {
        useLibrary 'org.apache.http.legacy'
    }

    这是proejct级别的builld.gradle文件

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
        repositories {
            jcenter()
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.5.0'
            classpath 'com.google.gms:google-services:1.5.0-beta2'
    
    
        }
    }
    
    allprojects {
        repositories {
            jcenter()
        }
    }

    帮助将得到赞赏!请分享您的想法以解决此错误 我试图处理1周内的错误,我没有得到任何可以为我工作的答案

    谢谢

0 个答案:

没有答案
相关问题