Android Studio APK解析错误解析软件包时出现问题

问题描述

我正在尝试生成APK 以安装我的应用(例如Google Play)。 APK在Android 10.0中可以正常使用,但尝试在 ANDROID 6.0 上安装时出现错误 [尝试在Android 6.0中安装时出错] [1] [1]:https://i.stack.imgur.com/C20RJ.jpg

我已经尝试过:

  1. 将gradle minSdkVersion更改为更低
  2. 两个手机均具有开发者权限
  3. 可以从未知来源安装应用。

但是那行不通。

即使在Android 6.0的调试模式下,我也可以通过Android Studio运行项目,这很有趣。而且效果很好。

我也使用Git。因此,我切换到了旧版本(有效!),但仍然存在相同的问题。 (我猜问题出在代码之外)

那是我的build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsversion "29.0.2"

    defaultConfig {
        applicationId "com.maliNowski.jump"
        minSdkVersion 23
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
        }
    }
    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

allprojects {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
    }
}

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9'
    implementation filetree(dir: 'libs',include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.preference:preference:1.1.0-alpha05'
    implementation files('libs\\java-android-websocket-client-1.2.2.jar')
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

解决方法

实际上我找到了解决方案。就我而言,我只需要为V1和V2版本生成APK。