找不到com.android.tools.build:aapt2:3.2.1-4818971。更新Android Studio 3.2.1之后

时间:2018-11-16 11:20:20

标签: android android-studio

enter image description here更新android studion 3.2.1之后,iam收到此错误。实际上,StreamLib模块用于支持模块,没有构建脚本,所有模块都请检查StreamLib.gridle

Could not find com.android.tools.build:aapt2:3.2.1-4818971.
Searched in the following locations:
    file:/Users/user/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom
    file:/Users/user/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-osx.jar
    file:/Users/user/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom
    file:/Users/user/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-osx.jar
    file:/Users/user/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom
    file:/Users/user/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-osx.jar
Required by:
    project :StreamingLib


this is the StreamingLib Gridle file : 

apply plugin: 'com.android.library'


android {
    compileSdkVersion 26
    buildToolsVersion '28.0.3'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
       // android.enableAapt2=false
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            jniLibs.srcDirs  'src/main/libs'
            jni.srcDirs = []
        }
    }
}



dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation files('libs/aapt2-3.2.1-4818971-windows.jar')
}

上述StreamingLib用于我的应用程序的支持库  请帮我 ?

这是主要级别的graigle文件

buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'

    }
}

apply plugin: 'com.android.application'

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

}

dependencies {
    implementation 'com.google.android.gms:play-services-gcm:10.2.6'
    implementation 'org.sufficientlysecure:openpgp-api:10.0'
    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
    implementation 'com.android.support:support-v13:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'org.bouncycastle:bcprov-jdk15on:1.52'
    implementation 'org.bouncycastle:bcmail-jdk15on:1.52'
    implementation 'org.jitsi:org.otr4j:0.22'
    implementation 'org.gnu.inet:libidn:1.15'
    implementation 'com.google.zxing:core:3.2.1'
    implementation 'com.google.zxing:android-integration:3.2.1'
    implementation 'de.measite.minidns:minidns-hla:0.2.1'
    implementation 'de.timroes.android:EnhancedListView:0.3.4'
    implementation 'me.leolin:ShortcutBadger:1.1.12@aar'
    implementation 'com.kyleduo.switchbutton:library:1.2.8'
    implementation 'org.whispersystems:signal-protocol-java:2.5.3'
    implementation 'com.wefika:flowlayout:0.4.1'
    implementation 'net.ypresto.androidtranscoder:android-transcoder:0.2.0'
    implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation 'com.googlecode.libphonenumber:libphonenumber:6.2'
    implementation project(':StreamingLib')
}

ext {
    travisBuild = System.getenv("TRAVIS") == "true"
    // allows for -Dpre-dex=false to be set
    preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
}

android {
    compileSdkVersion 26
    buildToolsVersion '28.0.3'

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 3
        versionName "2.0"
        archivesBaseName += "-$versionName"
        applicationId "com.abc"
        multiDexEnabled true
        //
    }

    dexOptions {
        // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
        preDexLibraries = preDexEnabled && !travisBuild
        javaMaxHeapSize "4g"

    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    if (project.hasProperty('mStoreFile') &&
            project.hasProperty('mStorePassword') &&
            project.hasProperty('mKeyAlias') &&
            project.hasProperty('mKeyPassword')) {
        signingConfigs {
            release {
                storeFile file(mStoreFile)
                storePassword mStorePassword
                keyAlias mKeyAlias
                keyPassword mKeyPassword
            }
        }
        buildTypes.release.signingConfig = signingConfigs.release
    } else {
        buildTypes.release.signingConfig = null
    }

    lintOptions {
        disable 'ExtraTranslation', 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
    }

    subprojects {

        afterEvaluate {
            if (getPlugins().hasPlugin('android') ||
                    getPlugins().hasPlugin('android-library')) {

                configure(android.lintOptions) {
                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
                }
            }

        }
    }

    packagingOptions {
        exclude 'META-INF/BCKEY.DSA'
        exclude 'META-INF/BCKEY.SF'
    }


}

0 个答案:

没有答案