- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当尝试在我的 android 设备上运行我的应用程序时,出现以下错误:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find runtime-2.4.0.aar (androidx.lifecycle:lifecycle-runtime:2.4.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime/2.4.0/runtime-2.4.0.aar
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
我试过:
我的build.gradle(应用级别)
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 31
defaultConfig {
applicationId "com.brianokoth.skillsapp"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.google.firebase:firebase-storage:20.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.firebaseui:firebase-ui-firestore:4.1.0'
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'androidx.lifecycle:lifecycle-runtime:2.4.0'
}
我的build.gradle(项目级别)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我期待任何帮助。
最佳答案
首先,您可以尝试 File -> Sync Project With Gradle Files
以确保它已正确导入。其次,最好添加所有 life cycle dependencies
而不是只添加一个,那已经过时了。所以删除当前的并改用这些:
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-alpha02"
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
关于java - Android Studio 编译错误 : Could not find runtime-2. 4.0.aar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70275458/
我们向客户发送了一个 android sdk (aar) 文件。我们的代码在内部使用两个第 3 方 aar,我们在我们的 repo 和 gradle 在运行时引用它。我的问题是如何将这些依赖项发送给客
我正在努力构建可用于其他应用程序的 SDK。 我的项目结构如下: ProjectFolder | +--AndroidLibs | | | +--UI (andro
如果我有作为 SDK 的项目 A,并且它作为 AAR 导出到项目 B 中,项目 B 将模块作为 AAR 导入,我该如何链接这两个模块,所以对项目 B 中的 AAR 所做的更改不会必须在原始项目-A中复
我是一名插件开发人员,我的插件依赖于两个 aar 库。当我导出为 aar 存档时,我的依赖库不是它的一部分。我的项目结构如下所述 App lib1 --aartool lib2 lib3
我有一个以 aar 格式分发的 android 库。它重300kb。我想创建另一个库,也是 aar 格式,其中依赖项中的第一个库。但是结果库权重是30kb,显然不包括第一个库。 我尝试使用 flatD
如何访问 AAR 库中的 Activity,它不是直接包含在项目中而是嵌入到另一个 AAR 库中? 我得到一个错误 java.lang.NoClassDefFoundError: Failed res
你能帮我理解构建 android 库并在用户应用程序中使用它的一般概念吗。 那么,有以下情况: 在android studio中有以下模块: 核心 数据 绘图 还有一个模块 应用 依赖于上述模块。 a
关于 Gradle 中 AAR 文件的传递依赖关系存在一些问题: Android Studio 0.2.3 cannot resolve transitive aar dependencies And
我看到了各种开发人员发布的问题(Android Studio combine 2 .aar into one 和其他人),但我还没有看到明确的答复使我能够创建一个包含 1 个或多个 AAR 或 JAR
我正在使用Xamarin开发一个APP,需要使用Android Studio(AS)开发的其他aar。 在 AS 中,我创建了一个名为“javaLib”的 Java 库模块。构建后,我得到了javaL
无法发布配置“文件”,无法发布 Artifact danlu-bluetooth.aar (/Users/xxx/work/xxx/workplace/androidcode/libraray/xxx
我正在使用 Android Studio 1.5。我有一个图书馆项目,core-speech-service.aar。此 AAR 文件已正确生成(所有类都构建并打包在 AAR 文件中的 classes
我写了一些库,它有一部分 UI。此外,此库使用其他库。我想提供版本 .aar 以在任何应用程序中使用此 UI 部分。 我的图书馆有下一个依赖: compile 'com.android.sup
所以,事情是这样的,我有一个 .aar 文件,当我将它添加为依赖项时,如下所示: 编译('com.foo:bar:1.0.0@aar') 它生成以下文件: build > intermediates
我正在使用另一个 aar 和 jar 文件依赖项创建 AAR 文件。我已成功创建 .aar 发布文件。 然后,我将新的 AAR 文件导入到示例项目中。该项目运行良好。当访问 aar 和 jar 类时,
我正在创建一个具有“directions-api.aar”(Here-Maps 小部件库)的旧依赖项的 android 应用程序,现在我需要为 Map 的实现添加“HERE-sdk.aar”。 这导致
我通过将我的应用程序转换为库来为应用程序贴上白色标签,并且我有一个配置文件被传递到库以更改颜色、添加新的加载动画、更改一些文本等。库拥有所有这些上面列出的依赖项。当我将库导入新应用程序时,由于新应用程
我有一个顶级 android 库模块(包含 res 文件夹)依赖于其他库子模块(无 res)。我想构建一个顶层模块的 fat aar,它应该包括子模块的 jar 以及我在 build.gradle 中
我在 Intranet maven repo 中有一个 utility.aar。它使用了一些众所周知的 jar ,例如 gson。我已将它们定义为实用程序模块的 build.gradle 中的编译依赖
我正在按照 camera_deep_ar 上的插件页面中给出的文档进行操作 我已将 minimumSdkVersion 设置为 19 在 AndroidManifest.xml 中正确赋予权限 正确设
我是一名优秀的程序员,十分优秀!