gpt4 book ai didi

java - 无法解析 android.arch.lifecycle :livedata:1. 1.1 Android Studio 3.6.1 Mac

转载 作者:行者123 更新时间:2023-12-01 17:47:22 25 4
gpt4 key购买 nike

打开项目或打开项目时会发生这种情况,我不知道Android Studio是否已损坏或可能是某些权限问题。

所有项目突然停止工作,并指示以下错误:

> Could not resolve android.arch.lifecycle:livedata:1.1.1.
Required by:
project :app > com.android.support:loader:28.0.0
> Could not resolve android.arch.lifecycle:livedata:1.1.1.
> Could not get resource
'https://dl.google.com/dl/android/maven2/android/arch/lifecycle/livedata/1.1.1/livedata-1.1.1.pom'.
> Failed to move file '/private/var/folders/yl/rjxf9qcx2rdfztl5mh93q_rm0000gn/T/gradle_download32524353575854917bin' into filestore at 'android.arch.lifecycle/livedata/1.1.1/b4b4d001ca961adb29783cfcdb61c36f877c51bf/livedata-1.1.1.pom'
> Failed to create parent directory '/Users/myuser/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/livedata' when creating directory '/Users/myuser/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/livedata/1.1.1/b4b4d001ca961adb29783cfcdb61c36f877c51bf'

我已将其安装在 MAC 中,但我的项目中没有明确的依赖关系。

  apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId 'com.example.myproject'
minSdkVersion 21
targetSdkVersion 28
versionCode 23
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
productFlavors {
}
}
def gsonVersion = "2.8.0"
def butterKnifeVersion = "8.8.1"
def retrofitVersion = "2.3.0"
def supportVersion = "28.0.0"
def okHttpVersion = "3.7.0"
def loggingInterceptorVersion = "3.8.0"
def circleImageViewVersion = "2.1.0"
def googleServiceVersion = "17.3.4"


dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:support-v4:$supportVersion"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'

implementation "com.google.firebase:firebase-messaging:$googleServiceVersion"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "com.jakewharton:butterknife:$butterKnifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$butterKnifeVersion"
implementation 'com.github.ViksaaSkool:AwesomeSplash:v1.0.0'
implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.google.code.gson:gson:$gsonVersion"
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$loggingInterceptorVersion"
implementation "de.hdodenhof:circleimageview:$circleImageViewVersion"
implementation('io.socket:socket.io-client:1.0.0') {

exclude group: 'org.json', module: 'json'
}

implementation 'com.heinrichreimersoftware:material-intro:1.6'
dependencies {
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
}

implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'



implementation 'com.facebook.shimmer:shimmer:0.4.0'

implementation 'com.github.MAXDeliveryNG:slideview:1.1.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'

}

apply plugin: 'com.google.gms.google-services'

和应用程序 gradle

buildscript {

repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.2.0'

classpath 'io.fabric.tools:gradle:1.28.1'
}
}

allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

我尝试更新到最新版本的 gradle 并更新库,但失败了。

更新:

我尝试给予 AndroidStudio 完全磁盘访问权限,但没有成功。

最佳答案

我的问题是 .gradle 19.26.53 库已损坏,我通过完全删除 Android Studio 解决了这个问题,使用这篇文章中的命令:

How to completely uninstall Android Studio on Mac?

关于java - 无法解析 android.arch.lifecycle :livedata:1. 1.1 Android Studio 3.6.1 Mac,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60845092/

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