gpt4 book ai didi

java - 为 JellyRefreshLayout 模块导入新的 Android 模块失败

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:23:00 26 4
gpt4 key购买 nike

我将 JellyRefreshLayout 作为模块导入(用于某些更新)

检查此链接: <强> https://github.com/allan1st/JellyRefreshLayout

但我总是遇到这个 gradle 构建错误:

信息: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

请指教!谢谢!

最佳答案

现在已经解决了。

问题是:internal_impl.jar 有时不在 retrolambda 类路径中。因为以下之一:

  • 因为依赖项可能会在第二次执行时更新。
  • 可能是 Gradle Android 插件中的错误。

解决方案是:在同步 gradle 之前,我在 gradle 终端的命令中运行 gradle 清理和组装:

./gradlew clean assembleDebug

来自 Gradle 终端。

请检查这个有用的对话:

https://github.com/evant/gradle-retrolambda/issues/105

关于java - 为 JellyRefreshLayout 模块导入新的 Android 模块失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39080551/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com