我有一个Android项目,它以前工作得很好。
今天我将Android Studio升级到Arctic Fox 2020.3。1,然后我在Android Studio Arctic Fox 2020.3中运行该项目。1,但我得到以下错误。
我调试了这个项目,我认为代码mavenCentral()
导致了错误,所以我用jcenter()
替换了mavenCentral()
,这个应用程序可以很好地工作。
我知道jcenter()
已经过时,但是为什么mavenCentral()
会导致错误呢?
错误
**Execution failed for task ':app:kaptGenerateStubsFreeDebugMiniKotlin'.
> Could not resolve all files for configuration ':app:kapt'.
> Failed to transform kotlinx-metadata-jvm-0.2.0.jar (org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.2.0) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not download kotlinx-metadata-jvm-0.2.0.jar (org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.2.0)
> Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.2.0/kotlinx-metadata-jvm-0.2.0.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.2.0/kotlinx-metadata-jvm-0.2.0.jar'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/127.0.0.1] failed: Connection refused: connect
> Failed to transform annotations-12.0.jar (com.intellij:annotations:12.0) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not download annotations-12.0.jar (com.intellij:annotations:12.0)
> Could not get resource 'https://repo.maven.apache.org/maven2/com/intellij/annotations/12.0/annotations-12.0.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/intellij/annotations/12.0/annotations-12.0.jar'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/127.0.0.1] failed: Connection refused: connect
> Failed to transform guava-29.0-jre.jar (com.google.guava:guava:29.0-jre) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not download guava-29.0-jre.jar (com.google.guava:guava:29.0-jre)
> Could not get resource 'https://repo.maven.apache.org/maven2/com/google/guava/guava/29.0-jre/guava-29.0-jre.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/google/guava/guava/29.0-jre/guava-29.0-jre.jar'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/127.0.0.1] failed: Connection refused: connect
> Failed to transform checker-qual-2.11.1.jar (org.checkerframework:checker-qual:2.11.1) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not download checker-qual-2.11.1.jar (org.checkerframework:checker-qual:2.11.1)
> Could not get resource 'https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/2.11.1/checker-qual-2.11.1.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/2.11.1/checker-qual-2.11.1.jar'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/127.0.0.1] failed: Connection refused: connect
> Failed to transform error_prone_annotations-2.3.4.jar (com.google.errorprone:error_prone_annotations:2.3.4) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not download error_prone_annotations-2.3.4.jar (com.google.errorprone:error_prone_annotations:2.3.4)
> Could not get resource 'https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/127.0.0.1] failed: Connection refused: connect**
*** Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.**
build.gradle
buildscript {
ext.kotlin_version = "1.5.0"
repositories {
google()
jcenter()
//mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.5"
}
}
allprojects {
repositories {
google()
jcenter()
//mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
您检查过主机文件中的repo.maven.apache.org?
原因:
[repo.maven.apache.org/127.0.0.1] failed: Connection refused: connect
我的GridbagLayout有些问题。我创建了一个JPanel(在本例中称为mainPanel),它的布局被设置为GridBagLayout。我已经为每个JButton指定了约束,并将约束添加到每个Button。现在,当我运行代码时,按钮总是紧挨着的,而不考虑我在约束中指示的Gridx/Gridy值。此外,按钮总是位于JFrame的中心,我希望一个按钮出现在右上角、左上角和南边。 这是我运行代码
问题内容: 我发现,当我编写“ pnlMap.add(map [i] [j])”时,键侦听器将无法工作。map是JButton的集合,pnlMap是JPanel。 公共游戏(玩家播放器){ 问题答案: 为了工作,必须将其注册为可聚焦的组件并使其具有键盘焦点。默认情况下,大多数容器都喜欢和无法将其聚焦(在考虑使它们成为容器之前,我会非常小心)。这意味着,一旦您添加了一个可以接受键盘焦点的组件(并且它
我的布局中有以下内容:; 我试图在<code>中使用的任何XML标记 我尝试了以下方法:; < li >文件- 似乎什么都不起作用。 智能感知/自动完成在标记外部工作,但不在标记内工作。 拜托,有人有解决方案吗? 我更改了<代码>
我正在使用Artisan::call('迁移');在Laravel控制器方法中,它在Laravel版本为4.1时工作。使用作曲家更新命令更新Laravel后(并在composer.js中设置laravel/框架:4.2.*),此控制器方法(因为这是其中唯一的命令)不再工作。 我甚至还加了“密码”= 这已经发生了:http://laravel.io/forum/06-02-2014-not-able
使用以前版本的 Android Studio 与候选版本 4(12 月 4 日)或更高版本一起正常工作: 在我看来和更新有关 这看起来很相似:https://github.com/robolectric/robolectric/issues/1136 编辑 工作:编译'com.google.android.gms:playservices:6.1。'