gpt4 book ai didi

android - 生成错误:更新到Gradle 4.4后 `Failed to resolve: leakcanary-android`

转载 作者:行者123 更新时间:2023-12-03 05:46:44 26 4
gpt4 key购买 nike

Failed to resolve: leakcanary-android



升级到4.4级后,出现此构建错误。

我启动了一个全新的Android Studio项目,并遇到了相同的错误。还有其他人有同样的问题吗?

我在Android Studio 3.1上。以下是我的全新项目的代码。

build.gradle
应用插件:“com.android.application”
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.xi_zz.myapplication"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
}

build.gradle(顶层)
buildscript {
    repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'


// 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-wrapper.properites
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

以下是我添加到此新项目中的唯一代码,该代码在 https://github.com/square/leakcanary中进行了说明。
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'

这是泄漏漏斗中的错误吗?

最佳答案

不太确定。这可能是Gradle 4.4的问题,因为我在更新到Gradle 4.5后解决了它。

关于android - 生成错误:更新到Gradle 4.4后 `Failed to resolve: leakcanary-android`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49739851/

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