web-dev-qa-db-ja.com

Gradleの同期に失敗しました:クラス 'org.gradle.internal.logging.LoggingManagerInternal'を読み込めません

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 '[email protected]'
                    }
                }
                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()
    }
}

どんなアイデアも私を助けてくれます。

7
Afnan Khalifa

私にとっては、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
8
Rahul

Android-maven-gradle-pluginのバージョンを適切なGradleバージョンで維持する必要があります。

特定のAndroid-maven-gradle-pluginに必要なGradleバージョンについてのアイデアがあります。

https://github.com/dcendents/Android-maven-gradle-plugin#note-on-releases

4
Rikin Prajapati

私にとっては、gradle-wrapper.propertiesを変更した後に機能しました。

distributionUrl = https://services.gradle.org/distributions/gradle-5.1.1-all.Zip

1
user3219477