生成已签名的 apk 不起作用,apk 未签名

Kha*_*aha 3 android android-studio apk-signing

我曾经从 Android Studio 生成签名的 apk 并且一切正常,直到我将 Android Studio 更新为3.3. 它生成一个apk,但在我尝试安装它后,它说:应用程序未安装!

我的试验是通过:

  1. 点击 build
  2. 生成签名的 Apk
  3. 选择APK并点击下一步
  4. 插入密钥库路径、密钥库密码、密钥别名、密钥密码
  5. 点击下一步
  6. 选择发布变体
  7. 单击完成

Apk 已生成但未签名!问题是什么 ?

这是在尝试上传到测试版之后

这是我的应用程序 build.gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    useLibrary 'org.apache.http.legacy'
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.twobreathe.soft2breathe"
        minSdkVersion 23
        targetSdkVersion 27
        versionCode 9
        versionName "1.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags ""
            }
        }
        vectorDrawables {
            useSupportLibrary true
        }
        resConfigs "en", "ja"
    }
    signingConfigs {
        release {
            keyAlias "[my key alias]"
            keyPassword "[my key password]"
            storeFile file("[path to the keystore file]")
            storePassword "[my store password]"
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            shrinkResources true
            pseudoLocalesEnabled false
        }

        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable true
        }


    }
    externalNativeBuild {
        cmake {
            path "src/main/cpp/fluidsynth/android/CMakeLists.txt"
        }
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    dataBinding {
        enabled true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildToolsVersion '28.0.3'
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.github.parse-community.Parse-SDK-Android:parse:1.18.4'
    implementation 'com.jjoe64:graphview:4.2.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.orhanobut:hawk:2.0.1'
    implementation 'xyz.sahildave:arclayout:1.0.0'
    implementation 'com.mikhaellopez:circularprogressbar:2.0.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    implementation 'com.github.GrenderG:Toasty:1.3.0'
    implementation 'com.kyleduo.switchbutton:library:2.0.0'
    implementation 'com.github.franmontiel:LocaleChanger:0.9.2'
    implementation 'cn.aigestudio.wheelpicker:WheelPicker:1.1.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
Run Code Online (Sandbox Code Playgroud)

Van*_*aga 5

更新到 3.3 后,出现很多与签署 APK 相关的问题。有时它不签署 apk,有时它说密钥不是私有的。

好吧,我在升级到 android studio 3.3 后也遇到了这个问题,我分 3 个步骤解决了。但首先要确保备份整个项目。

  1. 在 Android Studio 中,转到 File > Project Structure 并取消选中“use Embedded JDK”,然后单击 OK
  2. 转到计算机设置(系统设置)(win + 暂停键)然后转到高级系统设置>环境变量。如果 JAVA_HOME 不存在,则添加它并设置已安装 JDK 的路径。
    由于我找不到在我的项目中以某种方式升级到 android studio 3.3 设置的直接方法来修改 jdk 路径,我做了以下(最后一步)但请确保在此之前进行备份。
  3. 为了确保我在哪里引导到项目视图,我从根目录中删除了“.grade”、“.idea”、“capture”、“gradle”文件夹和“build”、“release”、“lib”文件夹。 app”保留“src”原样。删除了root.iml并没有删除app.iml文件然后重建项目,然后创建了Signed包。

经过2次尝试成功。老实说,我通过从备份恢复文件做了两次最后一步。删除这些文件夹时,我搞砸了 1 次。