2017-06-06 144 views
0

导入从GitHub这个项目,我碰到的这个消息:项目刷新失败 - 错误:原因:组织/ gradle产出/内部/ TrueTimeProvider

Gradle 'GameOfLife-master' project refresh failed 
Error:Cause: org/gradle/internal/TrueTimeProvider 

我试过的解决方案张贴here,清洗/重建(至少试图)项目,无效的缓存并尝试了不同版本的Gradle。没有任何工作。任何人有任何想法?

模块:应用程序 - 的build.gradle

buildscript { 
    repositories { 
     mavenCentral() 
     maven { url 'https://maven.fabric.io/public' } 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.2' 
     classpath "com.neenbedankt.gradle.plugins:android-apt:1.8" 
     classpath 'com.jakewharton.hugo:hugo-plugin:1.1.0' 
     classpath "net.rdrei.android.buildtimetracker:gradle-plugin:0.5.+" 
     classpath 'io.fabric.tools:gradle:1.+' 
     classpath 'hu.supercluster:paperwork-plugin:1.2.7' 
    } 
} 

apply plugin: 'com.android.application' 
apply plugin: 'android-apt' 
apply plugin: 'io.fabric' 
apply plugin: 'hugo' 
apply plugin: "build-time-tracker" 
apply plugin: 'hu.supercluster.paperwork' 

paperwork { 
    set = [ 
      gitInfo: gitInfo(), 
      gitSha: gitSha(), 
      buildTime: buildTime("yyyy-MM-dd HH:mm:ss", "GMT+01:00") 
    ] 
} 

def versionMajor = 1 
def versionMinor = 2 
def versionPatch = 0 

android { 
    compileSdkVersion androidCompileSdkVersion 
    buildToolsVersion androidBuildToolsVersion 

    defaultConfig { 
     applicationId 'hu.supercluster.gameoflife' 
     minSdkVersion androidMinSdkVersion 
     targetSdkVersion androidTargetSdkVersion 

     versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch 
     versionName "${versionMajor}.${versionMinor}.${versionPatch}" 

     testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner" 
    } 

    signingConfigs { 
     alpha {} 
     beta {} 
     release {} 
    } 

    buildTypes { 
     debug { 
      applicationIdSuffix ".debug" 
      versionNameSuffix "-debug" 
      resValue "string", "app_name_for_buildtype", "Game of Life (debug)" 
      minifyEnabled false 
      testCoverageEnabled = false 
     } 

     alpha { 
      applicationIdSuffix ".alpha" 
      versionNameSuffix "-alpha" 
      resValue "string", "app_name_for_buildtype", "Game of Life (alpha)" 
      minifyEnabled false 
      testCoverageEnabled = false 
      lintOptions { 
       disable 'MissingTranslation' 
      } 
     } 

     beta { 
      applicationIdSuffix ".beta" 
      versionNameSuffix "-beta" 
      resValue "string", "app_name_for_buildtype", "Game of Life (beta)" 
      minifyEnabled false 
      testCoverageEnabled = false 
     } 

     release { 
      resValue "string", "app_name_for_buildtype", "Game of Life" 
      minifyEnabled false 
      proguardFile 'proguard-project.txt' 
     } 
    } 

    sourceSets.main { 
     // src/gen is the target for generated content like json model 
     java.srcDirs += 'build/generated/source/db' 
    } 

    // avoid errors with message 'Duplicate files copied in APK ...' 
    packagingOptions { 
     exclude 'LICENSE.txt' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/ASL2.0' 
    } 
} 

afterEvaluate { 
    def propsFile = rootProject.file('keystore.properties') 
    def configName = 'release' 

    if (propsFile.exists() && android.signingConfigs.hasProperty(configName)) { 
     def props = new Properties() 
     props.load(new FileInputStream(propsFile)) 
     android.signingConfigs[configName].storeFile = rootProject.file(props['storeFile']) 
     android.signingConfigs[configName].storePassword = props['storePassword'] 
     android.signingConfigs[configName].keyAlias = props['keyAlias'] 
     android.signingConfigs[configName].keyPassword = props['keyPassword'] 
    } 
} 

repositories { 
    mavenCentral() 
    maven { url 'https://maven.fabric.io/public' } 
} 


dependencies { 
    compile 'com.android.support:appcompat-v7:24.2.0' 
    compile 'com.android.support:support-annotations:24.2.0' 
    compile 'com.android.support:support-v13:24.2.0' 
    compile 'com.android.support:support-v4:24.2.0' 

    // --------- 

    compile 'com.github.tslamic.adn:library:1.0' 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { transitive = true } 
    compile 'com.jakewharton.timber:timber:2.5.1' 
    compile 'com.squareup:otto:1.3.6' 
    compile 'hu.supercluster:paperwork:1.2.7' 

    // --------- 

    apt "org.androidannotations:androidannotations:" + androidAnnotationsVersion 
    compile("org.androidannotations:androidannotations-api:" + androidAnnotationsAPIVersion) 

    testCompile 'junit:junit:4.11' 
    testCompile 'org.mockito:mockito-core:1.9.5' 
    testCompile('com.squareup:fest-android:1.0.+') { exclude module: 'support-v4' } 
    testCompile "org.robolectric:robolectric:3.0" 

    androidTestCompile 'com.google.guava:guava:14.0.1', 
      'com.squareup.dagger:dagger:1.1.0', 
      'org.hamcrest:hamcrest-integration:1.1', 
      'org.hamcrest:hamcrest-core:1.1', 
      'org.hamcrest:hamcrest-library:1.1', 
      'com.jakewharton.espresso:espresso:1.1-r3' 
} 

apt { 
    arguments { 
     resourcePackageName android.defaultConfig.applicationId 
     androidManifestFile variant.outputs[0]?.processResources?.manifestFile 
    } 
} 

apply plugin: 'idea' 

idea { 
    module { 
     //and some extra test source dirs 
     testSourceDirs += file('src/test') 
    } 
} 

apply from: 'build-time-tracker.gradle' 

回答

1

您可以用--stacktrace运行得到一个完整的异常堆栈跟踪

摇篮有public API和private API的概念。基本上,org.gradle.internal中的任何内容都是私有API的一部分,并且Gradle团队可以在Gradle版本之间更改/删除这些类。理想情况下插件不应该引用internal类。任何引用internal API的插件作者都必须明白,此代码可能会与新版本的Gradle断开。

它看起来像你的插件之一引用internal API(org.gradle.internal.TrueTimeProvider)和插件建对摇篮的一个版本,您使用的是不同的Gradle版本上运行。

要解决,你需要确定哪些插件抛出异常(--stacktrace将在这里帮助)。然后,您需要将插件版本更改为与您的gradle版本兼容的版本,或者更改您正在运行的gradle版本。

+0

我的目标是刚刚获得应用程序的运行,所以我尝试了自定义位置设置为gradle这个(3.5和4.0rc)的新版本,但它到底给了相同的结果。 更改为gradle这个对的build.gradle类路径3.5.0,而不是2.3.2使其无法找到库,即使我已经设置它。它正在搜索gradle-3.5.0.jar,并且该文件无法在gradle文件夹中找到。 Android的监视器是空的,没有显示出的消息。 感谢您的完整的答案。 – user1938007

+1

只是一个猜测...但我会尝试注释掉'应用插件:“集结时间跟踪器”'。动态构建数字也是有问题的(例如'0.5。+'和'1. +')。更好地使用特定版本 –

+0

我尝试使用特定版本,但这不是我的项目。 注释“构建时间跟踪器”解决了原始问题。非常感谢你。 – user1938007

相关问题