gpt4 book ai didi

java - 无法加载类 'org.gradle.internal.impldep.com.google.common.collect.Lists'

转载 作者:行者123 更新时间:2023-12-05 00:03:44 73 4
gpt4 key购买 nike

我在我的 Android Studio 中导入了项目,但遇到了这个错误,

  • 引起:java.lang.NoClassDefFoundError:org/gradle/internal/impldep/com/google/common/collect/Lists
  • 引起:java.lang.ClassNotFoundException:org.gradle.internal.impldep.com.google.common.collect.Lists

这是我的依赖项

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:0.20.1' // From node_modules

implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

implementation("com.google.guava:guava:30.1-jre")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}

}

enter image description here

我已经看到这个问题了No Class Found: com.google.common.collect.Lists但是当我尝试添加 https://github.com/google/guava错误仍然存​​在

buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.2")
compile "com.google.guava:guava:16+"
compile "junit:junit:4.10"
}
}

allprojects {
repositories {

mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}

google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}

最佳答案

我也是这个问题。 Android Studio 完全搞砸了。使/重新安装/新项目无效。还是被坑了。删除了 .gradle 目录 (Linux)。那修好了。不知道始发事件。提交错误。

关于java - 无法加载类 'org.gradle.internal.impldep.com.google.common.collect.Lists',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65821231/

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