Proguard 无法读取 android.jar

Proguard fails to read android.jar

我只是启用 Proguard (minifyEnabled true) ...当我尝试构建 singed apk 时出现错误:

Cause: invalid entry CRC (expected 0x9aa3fedc but got 0xfeb7201b)

Exception while processing task java.io.IOException: Can't read [D:\AndroidStudio\AndroidStudioSDK\sdk\platforms\android-27\android.jar] (invalid entry CRC (expected 0x9aa3fedc but got 0xfeb7201b))

我的Gradle.app是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.test.app"
        manifestPlaceholders = [manifestApplicationId          : "${applicationId}",
                                onesignal_app_id               : "*****-****-****-****-***********",
                                onesignal_google_project_number: "REMOTE"]
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 8
        versionName "1.8"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes.each {
        it.buildConfigField 'String', 'SERVER_URL', serverUrl
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //ANDROID API
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:animated-vector-drawable:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:customtabs:27.1.1'
    implementation 'com.android.support:exifinterface:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:mediarouter-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:multidex:1.0.3'
    //Google API
    implementation 'com.google.android.gms:play-services-ads:17.1.2'
    implementation 'com.google.android.gms:play-services-gcm:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-cast-framework:16.1.2'
    implementation 'com.google.android.ads.consent:consent-library:1.0.7'
    //Google Exo Player
    implementation 'com.google.android.exoplayer:exoplayer:2.9.4'
    implementation 'com.google.android.exoplayer:exoplayer-core:2.9.4'
    implementation 'com.google.android.exoplayer:exoplayer-dash:2.9.4'
    implementation 'com.google.android.exoplayer:exoplayer-hls:2.9.4'
    implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.9.4'
    implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.4'
    //Google Firebase Api
    implementation 'com.google.firebase:firebase-core:16.0.6'
    //Other Libraries
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'me.relex:circleindicator:1.2.2@aar'
    implementation 'com.github.ornolfr:rating-view:0.1.2@aar'
    implementation 'cn.gavinliu.android.lib:ShapedImageView:0.8.4'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.mobsandgeeks:android-saripaar:2.0.2'
    implementation 'com.github.ixiDev:GDPRChecker:v0.2'
    implementation 'com.github.halilozercan:BetterVideoPlayer:1.1.0'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    //OneSignal
    implementation 'com.onesignal:OneSignal:3.9.1@aar'
    //You Api
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    //Test Api
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'

所以我没有改变任何东西,只是 minifyEnabled 从 false 到 true,我得到了错误。

invalid entry CRC (expected 0x9aa3fedc but got 0xfeb7201b)表示文件已损坏。

您必须使用 SDK 管理器卸载并重新安装 API 级别 27,才能解决这个问题。

并可能考虑购买新驱动器 - 或者至少检查完整性,例如。 hddscan.