【发布时间】:2016-12-29 01:33:38
【问题描述】:
我将 JellyRefreshLayout 作为模块导入(用于某些更新)
检查此链接: https://github.com/allan1st/JellyRefreshLayout
但我总是收到这个 gradle build 错误:
信息:Gradle 任务 [:app:generateDebugSources,
:app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :jellyrefresh:generateDebugSources, :jellyrefresh:mockableAndroidJar, :jellyrefresh:prepareDebugUnitTestDependencies, :jellyrefresh:generateDebugAndroidTestSources]
extractDebugAnnotations is incompatible with java 8 sources and has been disabled.
extractReleaseAnnotations is incompatible with java 8 sources and has been disabled.
:jellyrefresh:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:jellyrefresh:compileReleaseJavaWithJavac UP-TO-DATE
:jellyrefresh:compileRetrolambdaRelease FAILED
Error:Execution failed for task ':jellyrefresh:compileRetrolambdaRelease'.
> Could not resolve all dependencies for configuration ':jellyrefresh:retrolambdaConfig'.
> Could not resolve net.orfjackal.retrolambda:retrolambda:2.0.3.
Required by:
JellyRefreshLayout-master:jellyrefresh:unspecified
> No cached version of net.orfjackal.retrolambda:retrolambda:2.0.3 available for offline mode.
> No cached version of net.orfjackal.retrolambda:retrolambda:2.0.3 available for offline mode.
项目等级构建:
// 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:2.1.3'
classpath 'me.tatarka:gradle-retrolambda:3.2.0'
}
}
allprojects {
repositories {
jcenter()
}
}
应用分级:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "uk.co.imallan.jellyrefreshlayout"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile project(":jellyrefresh")
}
库模型:
repositories {
mavenCentral()
}
apply plugin: 'com.android.library'
apply plugin: 'me.tatarka.retrolambda'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
}
注意:我的项目 JDK 选择和默认 JDK 是: /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home
请指教! 谢谢!
【问题讨论】:
-
它已经是 unchecked man 了。
-
“离线模式”在末尾错误。使缓存无效并重新启动工作室。
-
我试过了,但是什么都没做。
标签: java android import module java-8