- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 安卓x 很长一段时间,我的 Android 项目编译得很好,但是最近我的 Android Studio 为所有 Activity 类抛出了大量的红色
因为cannot access 'androidx.activity.result.ActivityResultCaller' which is a supertype of ...
我用
AppCompatActivity 来自 androidx.appcompat:appcompat:1.1.0
我的 build.gradle 有:
ext.kotlin_version = '1.3.71'
...
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.3'
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx4608m
org.gradle.parallel=true
# Use kapt in parallel
kapt.use.worker.api=true
# Kapt compile avoidance
kapt.include.compile.classpath=false
最佳答案
这是因为 Gradle 在解析升级的依赖库版本时发生的 androidx.core:core
到 1.2.0 以上的版本,可能到 1.3.0-beta01 或 1.3.0-rc01AppCompatActivity
扩展 FragmentActivity
扩展 ComponentActivity
扩展 androidx.core.app.ComponentActivity
实现 ActivityResultCaller
介绍于 androidx.activity:activity:1.2.0-alpha03
只要。
要解决此问题,请将此依赖项添加到您的 模块 build.gradle
:
dependencies {
implementation "androidx.activity:activity-ktx:1.2.0-alpha03"
}
关于android - 无法访问 'androidx.activity.result.ActivityResultCaller',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61381545/
我正在使用 安卓x 很长一段时间,我的 Android 项目编译得很好,但是最近我的 Android Studio 为所有 Activity 类抛出了大量的红色 因为 cannot access 'a
我是一名优秀的程序员,十分优秀!