- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我刚刚在 Mac 上将 Android Studio 升级到了最新的稳定版本(Arctic Fox 2020.3.1),现在我的项目没有构建。我在 IDE 顶部栏中收到“未配置 Kotlin”,在构建输出中我收到此错误:
Could not find org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.5.21.
Required by:
project :app
我尝试将此依赖项添加到应用程序模块 Gradle 文件中,但错误仍然存在:
implementation "org.jetbrains.kotlin:kotlin-android-extensions-runtime:$kotlin_version"
供您引用,这是我的项目 Gradle 文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = "1.5.21"
version_navigation = "2.3.5"
version_lifecycle_extensions = "2.2.0"
version_lifecycle = "2.3.1"
version_room = "2.4.0-alpha04"
//version_room = "2.2.6"
version_coroutine = "1.5.0"
version_retrofit = "2.9.0"
version_moshi = "1.9.3"
version_retrofit_coroutines_adapter = "0.9.2"
version_glide = "4.12.0"
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
classpath 'com.android.support:multidex:1.0.3'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$version_navigation"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是我的模块 Gradle 文件:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id "org.jetbrains.kotlin.kapt"
id 'androidx.navigation.safeargs'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.virtualsheetmusic.vsheetmusic"
minSdkVersion 21
targetSdkVersion 30
versionCode 20
versionName "2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
//dataBinding includes viewBidning below https://stackoverflow.com/questions/58040778/android-difference-between-databinding-and-viewbinding
dataBinding true
// for view binding only:
// viewBinding true
}
}
dependencies {
//implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
//implementation "org.jetbrains.kotlin:kotlin-android-extensions-runtime:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation "androidx.fragment:fragment-ktx:1.3.6"
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.jakewharton.timber:timber:4.7.1'
//Lifecycle and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$version_lifecycle_extensions"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$version_lifecycle"
//Room
implementation "androidx.room:room-runtime:$version_room"
kapt "androidx.room:room-compiler:$version_room"
// Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:$version_room"
// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version_coroutine"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$version_coroutine"
// Testing
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//For Internet connectiona and JSON stuff...
// Moshi
implementation "com.squareup.moshi:moshi:$version_moshi"
implementation "com.squareup.moshi:moshi-kotlin:$version_moshi"
// Retrofit
implementation "com.squareup.retrofit2:retrofit:$version_retrofit"
//implementation "com.squareup.retrofit2:converter-scalars:$version_retrofit"
// Retrofit with Moshi Converter
implementation "com.squareup.retrofit2:converter-moshi:$version_retrofit"
implementation "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:$version_retrofit_coroutines_adapter"
//Glide
implementation "com.github.bumptech.glide:glide:$version_glide"
annotationProcessor "com.github.bumptech.glide:compiler:$version_glide"
//Recyclerview swipe-refresh...
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
//For PDF and download management from here: https://blog.mindorks.com/how-to-open-a-pdf-file-in-android-programmatically
//https://github.com/barteksc/AndroidPdfViewer
//implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
//implementation 'com.mindorks.android:prdownloader:0.6.0'
//This below to handle double clicks...
//implementation 'com.gitlab.developerdeveloperdeveloper:androidutilslibrary:1.0.0'
}
我已经尝试过这个:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
有什么想法吗?再次感谢。
最佳答案
我做了同样的事情并得到了相同的结果,我通过 Fil-> Sync project with gradle files 解决了它
关于android - 更新到 Android Studio 北极狐,现在我得到 "Kotlin not configured",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68567195/
将 AndroidStudio 更新为 4.2 后我在可调试过程中看不到我的应用程序。更新前一切正常。我尝试但没有任何改变的是: - 重启我的手机 - 重启安卓工作室 - 重启电脑 - 使缓存无效 -
我最近安装了 Android Studio Arctic Fox v2020.3.1 Beta 2 以便能够使用 Jetpack Compose在我们的项目中,因为我无法在 AS 4.2.1 上这样做
无法加载类“org.gradle.api.publication.maven.internal.MavenPomMetaInfoProvider”。 应用插件:'com.github.dcendent
我刚刚在 Mac 上将 Android Studio 升级到了最新的稳定版本(Arctic Fox 2020.3.1),现在我的项目没有构建。我在 IDE 顶部栏中收到“未配置 Kotlin”,在构建
今天刚注意到Arctic Fox 更新了Beta 4。之前没有问题,我决定升级我的Beta 3。与往常一样,AGP 也需要升级。在我尝试使用新的 Gradle n AGP 构建项目之前,新的 Beta
今天我将我的 Android Studio 更新到最新的稳定版本 Android Studio Arctic Fox | 2020.3.1 补丁 4每当打开 xml 时,即使旧项目或新项目和某些属性在
我正在尝试使用带有 BasicActivity 模板的新项目向导在 Android Studio Canary 14 上创建一个新项目(Test8),但我遇到了构建错误。 这是错误日志 Setting
我正在尝试使用 Android Studio Arctic Fox (2020.3.1) Beta 3 构建一个 Jetpack Compose 项目,构建失败并出现以下错误。 Unable to f
刚刚更新到 Mac 上的 Android Studio Arctic Fox,在修复和更新了所有 Gradle 设置以使其与 Gradle 7.0 以及这个新版本要求我做的任何事情之后,我现在在构建我
无法将 Android Studio 4.1.2 更新到 Android Studio 2020.3.1 北极狐 任何人都可以帮助我吗? 最佳答案 我通过简单地从 Android Studio web
我面临一个奇怪的问题。在我更新我的 Android Studio 之前,flutter doctor 一切正常。一旦我更新了 Android Studio,当我运行医生时,它会显示“无法找到 bund
我是一名优秀的程序员,十分优秀!