簡體   English   中英

從 android studio 生成的簽名 apk 在設備上安裝時出現錯誤“解析包時出現問題”

[英]generated signed apk from android studio gives error "there was a problem parsing the package" on installing on device

在通過物理設備在模擬器或設備上進行測試期間,該應用程序運行良好。 但是當我嘗試在 android 工作室中生成簽名的 apk 時,生成的簽名應用程序不會安裝在真實設備上。 它顯示錯誤“解析包時出錯”。 我試過Minify enabled false/true我試過 deleting.gradle and.idea試過多個鍵* enter code here沒有任何效果。 請幫助。

我的 Gradle

{
plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.reg.nsb"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.google.firebase:firebase-messaging:22.0.0'
    implementation 'com.google.firebase:firebase-config:21.0.0'
    implementation 'com.google.firebase:firebase-analytics:19.0.0'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    implementation 'com.intuit.sdp:sdp-android:1.0.6'
    implementation 'com.intuit.ssp:ssp-android:1.0.6'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.flaviofaria:kenburnsview:1.0.7'
    implementation 'com.mindorks.android:prdownloader:0.6.0'
    implementation 'com.android.volley:volley:1.1.0'
}
}

如果是,請檢查設備上是否已安裝調試版本,然后刪除已安裝在設備中的調試版本並再次安裝已簽名的 apk

希望它可以幫助你

-嗨,我遇到了類似的錯誤,問題似乎是 targetsdkversion。 我的 targetsdkversion 是 31,它在 android 12 設備上出現解析錯誤,但它確實安裝在我的 android 9 設備上。

  • 從外部源安裝時
  • 我將其更改為 29,它現在似乎正在安裝在我的 android 12 設備上

我希望它能幫助你

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM