nas*_*dam 9 android gradle android-studio build.gradle android-gradle-plugin
这是编译导入的应用程序后显示的错误:**无法找到方法“org.gradle.api.artifacts.result.ComponentSelectionReason.getDescription()Ljava/lang/String;”。导致此意外错误的可能原因包括: Gradle 的依赖项缓存可能已损坏(有时会在网络连接超时后发生。) 重新下载依赖项并同步项目(需要网络)
Gradle 构建进程(守护进程)的状态可能已损坏。停止所有 Gradle 守护进程可能会解决此问题。停止 Gradle 构建进程(需要重新启动)
您的项目可能正在使用第三方插件,该插件与项目中的其他插件或项目请求的 Gradle 版本不兼容。
如果 Gradle 进程损坏,您还可以尝试关闭 IDE,然后终止所有 Java 进程。**
构建.gradle
var = '4.0.1'
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.versions = [
'compileSdk' : 30,
'targetSdk' : 30,
'fragment' : '2.3.5',
'core' : '1.6.0',
'butterknife' : '10.2.3',
'constraint' : '1.1.3',
'dagger' : '2.37',
'espresso' : '3.0.2',
'glide' : '4.12.0',
'gson' : '2.8.7',
'junit' : '4.13',
'leakcanary' : '1.6.3',
'lifecycle' : '1.1.1',
'mockito' : '1.10.19',
'powerMockito' : '1.6.2',
'hamcrest' : '1.3',
'okhttp' : '5.0.0-alpha.2',
'retrofit' : '2.9.0',
'room' : '1.1.1',
'runner' : '1.0.2',
'rxandroid' : '3.0.0',
'rxjava' : '3.0.13',
'supportlibrary' : '28.0.0',
'timber' : '4.7.1',
'firebase' : '22.0.0',
'youtube' : '2.1.0',
'exoplayer' : '2.11.7',
'stringcare_version' : '4.0.1',
]
repositories {
google()
mavenCentral()
gradlePluginPortal()
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
url 'https://android-sdk.is.com/'
}
maven { url 'https://artifacts.applovin.com/android' }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.google.gms:google-services:4.3.10'
classpath "com.stringcare:plugin:${versions.stringcare_version}"
classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:+"
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public'}
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven {
url "https://artifactory.appodeal.com/appodeal"
}
maven {
url 'https://android-sdk.is.com/'
}
maven {
url "https://dl.appnext.com/"
}
maven {
url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
credentials {
// Be sure to add these non-sensitive credentials in order to retrieve dependencies from
// the private repository.
username 'paypal_sgerritz'
password 'AKCp8jQ8tAahqpT5JjZ4FRP2mW7GMoFZ674kGqHmupTesKeAY2G8NcmPKLuTxTGkKjDLRzDUQ'
}
}
mavenLocal()
}
}
ext.versions2 = [
'api' : 'https://api.envato.com/v3/',
'api2' : 'https://api.yobdev.live/easyplex/api/'
]
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
应用程序\build.gradle
var = '4.0.1'
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.versions = [
'compileSdk' : 30,
'targetSdk' : 30,
'fragment' : '2.3.5',
'core' : '1.6.0',
'butterknife' : '10.2.3',
'constraint' : '1.1.3',
'dagger' : '2.37',
'espresso' : '3.0.2',
'glide' : '4.12.0',
'gson' : '2.8.7',
'junit' : '4.13',
'leakcanary' : '1.6.3',
'lifecycle' : '1.1.1',
'mockito' : '1.10.19',
'powerMockito' : '1.6.2',
'hamcrest' : '1.3',
'okhttp' : '5.0.0-alpha.2',
'retrofit' : '2.9.0',
'room' : '1.1.1',
'runner' : '1.0.2',
'rxandroid' : '3.0.0',
'rxjava' : '3.0.13',
'supportlibrary' : '28.0.0',
'timber' : '4.7.1',
'firebase' : '22.0.0',
'youtube' : '2.1.0',
'exoplayer' : '2.11.7',
'stringcare_version' : '4.0.1',
]
repositories {
google()
mavenCentral()
gradlePluginPortal()
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
url 'https://android-sdk.is.com/'
}
maven { url 'https://artifacts.applovin.com/android' }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.google.gms:google-services:4.3.10'
classpath "com.stringcare:plugin:${versions.stringcare_version}"
classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:+"
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public'}
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven {
url "https://artifactory.appodeal.com/appodeal"
}
maven {
url 'https://android-sdk.is.com/'
}
maven {
url "https://dl.appnext.com/"
}
maven {
url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
credentials {
// Be sure to add these non-sensitive credentials in order to retrieve dependencies from
// the private repository.
username 'paypal_sgerritz'
password 'AKCp8jQ8tAahqpT5JjZ4FRP2mW7GMoFZ674kGqHmupTesKeAY2G8NcmPKLuTxTGkKjDLRzDUQ'
}
}
mavenLocal()
}
}
ext.versions2 = [
'api' : 'https://api.envato.com/v3/',
'api2' : 'https://api.yobdev.live/easyplex/api/'
]
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
Run Code Online (Sandbox Code Playgroud)
gradle.properties
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx4096m
android.nonTransitiveRClass=true
org.gradle.daemon=true
org.gradle.parallel=true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Run Code Online (Sandbox Code Playgroud)
将我的 Ionic 项目迁移到 Capacitor 3 后遇到了同样的问题。通过安装最新的 Android Studio 版本和 Android SDK 解决了这个问题。 https://github.com/ionic-team/capacitor/issues/4592
| 归档时间: |
|
| 查看次数: |
19979 次 |
| 最近记录: |