gpt4 book ai didi

java - Gradle 同步失败 : Unable to load class 'org.gradle.internal.logging.LoggingManagerInternal'

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:24:43 24 4
gpt4 key购买 nike

我试图在我的 android 项目中导入新的库模块(使用 android studio),可以正常工作,但是当我导入它时出现此错误(尝试同步 gradle 时):

Gradle sync failed: Unable to load class
'org.gradle.internal.logging.LoggingManagerInternal'.

模块的bulid.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.amazon.mysampleapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled = true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}

lintOptions {
abortOnError false
}

sourceCompatibility = 1.7
targetCompatibility = 1.7
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile fileTree(include: ['*.jar'], dir: 'app/libs')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:support-v4:23.1.0'
compile('com.amazonaws:aws-android-sdk-core:2.2.18')
compile('com.amazonaws:aws-android-sdk-cognito:2.2.18')
compile('com.amazonaws:aws-android-sdk-mobileanalytics:2.2.18')
compile('com.amazonaws:aws-android-sdk-sns:2.2.18')
compile 'com.google.android.gms:play-services-gcm:7.8.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'io.reactivex:rxjava:1.1.6'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
}

库的 bulid.gradle

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

def siteUrl = 'https://github.com/Frederikos/RxImagePicker'
def gitUrl = 'https://github.com/Frederikos/RxImagePicker.git'

version = "1.1.9"
group = "com.mlsdev.rximagepicker"

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven"
name = "RxImagePicker"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 8
versionName "1.1.9"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'RxImagePicker an easy way to get image from Gallery or Camera with request runtime permission on Android M. Using RxJava'
url siteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'frederikos'
name 'frederikos'
email 'frederikoss@gmail.com'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl

}
}
}
}
}

dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'io.reactivex:rxjava:1.0.14'
compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
// testCompile 'junit:junit:4.12'
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}

task findConventions << {
println project.getConvention()
}

根级 bulid.gradle

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'me.tatarka:gradle-retrolambda:3.2.5'

}
}

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'


allprojects {
repositories {
jcenter()
}
}

任何想法都可以帮助我。

最佳答案

对我来说,它在更改 gradle-wrapper.properties 后起作用。

我更改了 distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

关于java - Gradle 同步失败 : Unable to load class 'org.gradle.internal.logging.LoggingManagerInternal' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38458305/

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