错误:无法打开APK:无效的偏移量

时间:2019-07-29 14:23:42

标签: java android android-studio gradle

所有项目均成功构建,但 尝试运行或调试项目时出现此错误。 错误:

  

Android资源链接失败W / ziparchive(6524):邮编:找不到   lfh开始时出现签名,offset = 41550366错误:无法打开APK:   无效的偏移量。

我确实尝试过构建,清理,重建 无效现金重启 用Gradle文件同步项目 将Gradle,android studio更新到最新版本

我的Build.gradle应用程序:

apply plugin: 'com.android.application'

android {
    defaultConfig {
        applicationId "com.geesdsada.app"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 4
        versionName "4.0"
        vectorDrawables.useSupportLibrary = true

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        defaultConfig {
            multiDexEnabled true
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
}
dependencies {
    //fonts
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    //CounterFAB
    implementation 'com.github.andremion:counterfab:1.0.1'
    //
    implementation 'com.github.jd-alexander:android-flat-button:v1.1'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.stripe:stripe-android:6.1.2'
    implementation 'com.google.android.gms:play-services-base:16.1.0'
    implementation 'com.google.android.gms:play-services-analytics:16.0.8'
    implementation 'com.google.firebase:firebase-database:16.1.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.squareup.okhttp3:okhttp:3.0.1'
    implementation 'com.github.d-max:spots-dialog:0.7@aar'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'io.paperdb:paperdb:2.1'
    //add libraries
    implementation 'me.zhanghai.android.materialratingbar:library:1.3.2'
    implementation 'com.stepstone.apprating:app-rating:2.0.0'
    implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    implementation 'io.paperdb:paperdb:2.1'
    implementation 'com.github.rey5137:material:1.2.4'
    implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
    implementation 'com.parse:parse-android:1.16.3'
    //update version to the latest one
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.google.firebase:firebase-auth:16.2.1'
    implementation 'com.google.firebase:firebase-core:16.0.8'
    implementation 'com.google.firebase:firebase-database:16.1.0'
    implementation 'com.firebaseui:firebase-ui-database:1.2.0'
    implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
    implementation 'com.squareup.picasso:picasso:2.5.0'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

}

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

所有代码都编写正确并且运行良好,但是突然出现了该错误。

1 个答案:

答案 0 :(得分:0)

我在Android Studio中得到了它,而我所做的全部修复工作都是转到“构建”>“清理项目”,它就可以了。现在重建(构建->重建)您的项目。